Commit 69e628c3 by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !1
2 parents c477dd39 9a095ead
Showing 77 changed files with 2550 additions and 832 deletions
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
"glsx-components": "^1.3.3", "glsx-components": "^1.3.7",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1", "eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.14.1", "node-sass": "^4.12.0",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"vue-cli-plugin-element": "^1.0.1", "vue-cli-plugin-element": "^1.0.1",
......
...@@ -59,7 +59,32 @@ export default { ...@@ -59,7 +59,32 @@ export default {
#app { #app {
padding: 0px 20px 20px 40px; padding: 0px 20px 20px 40px;
// overflow-y: auto; // overflow-y: auto;
margin-right: 20px;
height: 100%; height: 100%;
} }
.el-switch__label--left {
position: relative;
margin-left: -20px;
left: 45px;
color: #fff;
z-index: -1111;
}
.el-switch__core {
width: 50px !important;
}
.el-switch__label--right {
position: relative;
right: 46px;
color: #fff;
z-index: -1111;
}
.el-switch__label--right.is-active {
z-index: 1111;
color: #fff !important;
}
.el-switch__label--left.is-active {
z-index: 1111;
color: #999999 !important;
}
</style> </style>
> >
...@@ -48,4 +48,13 @@ const updateCardContent = params => { ...@@ -48,4 +48,13 @@ const updateCardContent = params => {
}) })
} }
export { getCenterListApi,getMoreMerchant ,updateCardContent,getCardContent}
\ No newline at end of file \ No newline at end of file
const memberExportApi = params =>{
params.method=`scrm.api.equity.card.merchant.record.export`
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
export { getCenterListApi,getMoreMerchant ,updateCardContent,getCardContent,memberExportApi}
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,8 @@ const defaultPath = 'scrm.api.coupon.' ...@@ -4,7 +4,8 @@ const defaultPath = 'scrm.api.coupon.'
//优惠券列表 //优惠券列表
const getMerchantListApi = params => { const getMerchantListApi = params => {
params.method = `${defaultPath}list.merchant` // params.method = `${defaultPath}list.merchant`
params.method = 'scrm.backstage.coupon.list.merchant'
return http({ return http({
url: 'rop-scrm-coupon/router', url: 'rop-scrm-coupon/router',
method: 'GET', method: 'GET',
......
import { http } from '@/main' import { http, http2 } from '@/main'
const path = 'entmicro.api.mass.' const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router' const URL = 'rop-scrm-entmicro/router'
...@@ -56,9 +56,20 @@ const listDepartmentTree = params => { ...@@ -56,9 +56,20 @@ const listDepartmentTree = params => {
}) })
} }
const querylabeltree = params => { const findLordGroup = params => {
params.method = 'scrm.api.datahub.label.querylabeltree' params.method = 'entmicro.api.staff.findLordGroup'
return http({ return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const querylabeltree = params => {
// params.method = 'scrm.api.datahub.label.querylabeltree'
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
return http2({
url: '/rop-scrm-datahub/router', url: '/rop-scrm-datahub/router',
method: 'POST', method: 'POST',
data: params, data: params,
...@@ -165,6 +176,7 @@ const remindUserGroup = params => { ...@@ -165,6 +176,7 @@ const remindUserGroup = params => {
sign: true sign: true
}) })
} }
const getMerchant = params => { const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant' params.method = 'scrm.api.coupon.list.merchant'
return http({ return http({
...@@ -174,6 +186,7 @@ const getMerchant = params => { ...@@ -174,6 +186,7 @@ const getMerchant = params => {
sign: true sign: true
}) })
} }
const getCard = params => { const getCard = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid' params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({ return http({
...@@ -183,6 +196,27 @@ const getCard = params => { ...@@ -183,6 +196,27 @@ const getCard = params => {
sign: true sign: true
}) })
} }
const merchant = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantOpen = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getCoupon = params => { const getCoupon = params => {
params.method = 'scrm.api.boutiquecoupon.coupon.page' params.method = 'scrm.api.boutiquecoupon.coupon.page'
return http({ return http({
...@@ -192,6 +226,7 @@ const getCoupon = params => { ...@@ -192,6 +226,7 @@ const getCoupon = params => {
sign: true sign: true
}) })
} }
const getPackage = params => { const getPackage = params => {
params.method = 'scrm.api.equity.package.info.list.with.page' params.method = 'scrm.api.equity.package.info.list.with.page'
return http({ return http({
...@@ -211,6 +246,7 @@ const getActivity = params => { ...@@ -211,6 +246,7 @@ const getActivity = params => {
sign: true sign: true
}) })
} }
const nameVaild = params => { const nameVaild = params => {
params.method = 'entmicro.api.one.template.name.valid' params.method = 'entmicro.api.one.template.name.valid'
return http({ return http({
...@@ -220,6 +256,87 @@ const nameVaild = params => { ...@@ -220,6 +256,87 @@ const nameVaild = params => {
sign: true sign: true
}) })
} }
const getStatus = params => {
params.method = 'scrm.api.work.wechat.access.status'
return http({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
const templatePage = params => {
params.method = `${path}template.page.search`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateSave = params => {
params.method = `${path}template.save`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateUpdate = params => {
params.method = `${path}template.update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const createdNameList = params => {
params.method = `${path}template.created.name.list`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateDetail = params => {
params.method = `${path}template.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const groupDetailUpdate = params => {
params.method = `${path}update.group.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const followerType = params => {
params.method = 'entmicro.api.staff.listEntFollowerType'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
customerList, customerList,
customerGroupList, customerGroupList,
...@@ -240,7 +357,18 @@ export default { ...@@ -240,7 +357,18 @@ export default {
getMerchant, getMerchant,
getCard, getCard,
getCoupon, getCoupon,
merchant,
merchantOpen,
getPackage, getPackage,
getActivity, getActivity,
nameVaild nameVaild,
getStatus,
templatePage,
templateSave,
templateUpdate,
createdNameList,
templateDetail,
groupDetailUpdate,
findLordGroup,
followerType
} }
import { http } from '@/main'
const getFollowerStaffListApi = params => {
params.method = 'entmicro.api.staff.listFollowerStaffByPage'
return http({
url: 'rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
const getListApi = params => {
params.method = 'scrm.api.coupon.saas.directional.gift.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
const giftExportApi = params => {
params.method = 'scrm.api.coupon.saas.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.directional.gift.delete'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 获取详情
const getGiftInfoApi = params => {
params.method = 'scrm.api.coupon.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'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
// returnAll: true
})
}
// 导出已领取礼包
const exportGiftInfoApi = params => {
params.method = 'scrm.api.coupon.user.saas.directional.gift.list.export'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
})
}
// 编辑-选择定向礼包列表
const getDirectionalGiftListApi = params => {
params.method = 'scrm.api.coupon.directional.gift.coupon.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
const insertGiftApi = params => {
params.method = 'scrm.api.coupon.directional.gift.create'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi }
...@@ -87,4 +87,14 @@ const updateTakeProApi = params => { ...@@ -87,4 +87,14 @@ const updateTakeProApi = params => {
}) })
} }
export default { getListApi, getProShareApi, topProApi, updateStatusProApi, deleteTakeProApi, getProInfoApi, insertOrUpdateProApi, updateTakeProApi } const getGoodsCommentListApi = params => {
params.method = 'scrm.api.shopmall.backstage.orderGoodsComment.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getListApi, getProShareApi, topProApi, updateStatusProApi, deleteTakeProApi, getProInfoApi, insertOrUpdateProApi, updateTakeProApi, getGoodsCommentListApi }
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,6 @@ const getLoginCount = params => { ...@@ -9,7 +9,6 @@ const getLoginCount = params => {
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getServiceListApi = params => { const getServiceListApi = params => {
......
...@@ -5,7 +5,7 @@ html { ...@@ -5,7 +5,7 @@ html {
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
background-color: #F4F5FA; background-color: #f4f5fa;
} }
.el-range-editor.is-active, .el-range-editor.is-active,
...@@ -25,15 +25,15 @@ html { ...@@ -25,15 +25,15 @@ html {
} }
.live-room .container { .live-room .container {
background: #FFFFFF; background: #ffffff;
margin: 20px 0px; margin: 20px 0px;
padding: 15px 20px; padding: 15px 20px;
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10); box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.1);
} }
.fr-mr0 { .fr-mr0 {
float: right; float: right;
margin-right: 0!important; margin-right: 0 !important;
} }
//输入框后置文字(如 “元”) //输入框后置文字(如 “元”)
...@@ -66,7 +66,7 @@ html { ...@@ -66,7 +66,7 @@ html {
} }
.ellipsis-2-text:after { .ellipsis-2-text:after {
content: "..."; content: '...';
position: absolute; position: absolute;
bottom: 0; bottom: 0;
right: 15px; right: 15px;
...@@ -84,8 +84,8 @@ html { ...@@ -84,8 +84,8 @@ html {
padding: 10px 16px; padding: 10px 16px;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
background-color: #E6E9FF; background-color: #e6e9ff;
border: 1px solid #5850FF; border: 1px solid #5850ff;
margin-bottom: 20px; margin-bottom: 20px;
border-radius: 4px; border-radius: 4px;
} }
...@@ -96,7 +96,7 @@ html { ...@@ -96,7 +96,7 @@ html {
} }
.marketing .list-tips .red-txt { .marketing .list-tips .red-txt {
color: #EB4E4E; color: #eb4e4e;
} }
.marketing .wechat-container { .marketing .wechat-container {
...@@ -127,6 +127,11 @@ html { ...@@ -127,6 +127,11 @@ html {
margin-bottom: 18px; margin-bottom: 18px;
} }
.marketing .default-blue-btn {
color: #5850ff;
border-color: #5850ff;
}
.el-scrollbar__bar.is-horizontal { .el-scrollbar__bar.is-horizontal {
height: 10px !important; height: 10px !important;
left: 10px; left: 10px;
...@@ -143,7 +148,7 @@ html { ...@@ -143,7 +148,7 @@ html {
.marketing .table-btns .el-button { .marketing .table-btns .el-button {
padding: 0 0 0 5px; padding: 0 0 0 5px;
margin-left: 5px; margin-left: 5px;
border-left: 1px solid #DCDFE6; border-left: 1px solid #dcdfe6;
border-radius: 0; border-radius: 0;
} }
...@@ -167,10 +172,18 @@ html { ...@@ -167,10 +172,18 @@ html {
height: 120px; height: 120px;
} }
.marketing .m-t-8 {
margin-top: 8px;
}
.marketing .m-t-10 { .marketing .m-t-10 {
margin-top: 10px; margin-top: 10px;
} }
.marketing .m-b-10 {
margin-bottom: 10px;
}
.marketing .m-b-20 { .marketing .m-b-20 {
margin-bottom: 20px; margin-bottom: 20px;
} }
...@@ -200,10 +213,32 @@ html { ...@@ -200,10 +213,32 @@ html {
padding-left: 40px; padding-left: 40px;
} }
.marketing .circle {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 6px;
margin-bottom: 3px;
background-color: #5850ff;
}
.marketing .grey {
background-color: #999999;
}
.marketing .txt-grey {
color: #999999;
}
.marketing .txt-center { .marketing .txt-center {
text-align: center; text-align: center;
} }
.marketing .cursor-pointer {
cursor: pointer;
color: #5850ff;
}
.marketing .edit-tips { .marketing .edit-tips {
line-height: 20px; line-height: 20px;
font-size: 14px; font-size: 14px;
...@@ -231,6 +266,11 @@ html { ...@@ -231,6 +266,11 @@ html {
justify-content: space-between; justify-content: space-between;
} }
.marketing .flex-wrap {
display: flex;
flex-wrap: wrap;
}
.marketing .flex-grow { .marketing .flex-grow {
flex: 1; flex: 1;
} }
...@@ -240,7 +280,7 @@ html { ...@@ -240,7 +280,7 @@ html {
font-weight: 600; font-weight: 600;
height: 58px; height: 58px;
line-height: 58px; line-height: 58px;
border-bottom: 1px solid #E7EAEC; border-bottom: 1px solid #e7eaec;
margin: 0 0; margin: 0 0;
padding: 0 0 0 20px; padding: 0 0 0 20px;
} }
...@@ -300,12 +340,12 @@ html { ...@@ -300,12 +340,12 @@ html {
} }
.el-tag { .el-tag {
color: #666!important; color: #666 !important;
font-size: 14px!important; font-size: 14px !important;
} }
.el-tag.el-tag--info { .el-tag.el-tag--info {
background: #fafbfe !important; background: transparent !important;
border: 1px solid #e8e8ea !important; border: 1px solid #e8e8ea !important;
border-radius: 4px; border-radius: 4px;
color: #666; color: #666;
...@@ -314,3 +354,58 @@ html { ...@@ -314,3 +354,58 @@ html {
.el-tag.el-tag--info.el-tag--plain { .el-tag.el-tag--info.el-tag--plain {
background: transparent !important; background: transparent !important;
} }
/* tab */
.marketing .el-tabs__nav-wrap:after {
opacity: 0;
}
.marketing .el-tabs__item {
height: 20px !important;
line-height: 10px !important;
}
.marketing .el-tabs__item {
width: 120px;
height: 40px !important;
line-height: 40px !important;
font-size: 14px;
text-align: center;
border: 0 !important;
background: #ffffff;
color: #999999;
border-radius: 0px 4px 0px 0px;
border: 1px solid #f4f6fc;
padding: 0;
}
.marketing .el-tabs__active-bar {
display: none;
}
.marketing .el-tabs__header {
margin: 0 !important;
}
.marketing .el-tabs__item.is-active {
color: #5850ff;
background: #f4f6fc !important;
border-radius: 4px 0px 0px 0px;
border: 1px solid #f4f6fc !important;
}
.el-message--info {
height: 40px;
background: #e6e9ff;
border: 1px solid #5850ff;
border-radius: 4px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: #5850ff;
font-size: 16px;
}
/* tab */
...@@ -68,37 +68,42 @@ function exportFn(url) { ...@@ -68,37 +68,42 @@ function exportFn(url) {
document.body.appendChild(iframe) document.body.appendChild(iframe)
} }
// function aToExport(url) { function aToExport(url) {
// var a = document.createElement('a') var a = document.createElement('a')
// a.setAttribute('id', 'exportToExport') a.setAttribute('id', 'exportToExport')
// a.setAttribute('href', url) a.setAttribute('href', url)
// a.setAttribute('target', '_blank') a.setAttribute('target', '_blank')
// document.body.appendChild(a) document.body.appendChild(a)
// a.click() a.click()
// } }
const orderManageStatusList = [ const orderManageStatusList = [
{ confId: '1', confName: '未支付' }, { confId: '1', confName: '待付款' },
{ confId: '2', confName: '已支付' }, { confId: '2', confName: '已支付' },
{ confId: '3', confName: '已失效' }, { confId: '3', confName: '已失效' },
{ confId: '4', confName: '已发货' }, { confId: '21', confName: '待收货(待核销)' },
{ confId: '5', confName: '已收货' }, { confId: '22', confName: '已收货(已核销)' },
{ confId: '6', confName: '待审核' }, { confId: '6', confName: '待发货' },
{ confId: '7', confName: '审核成功' }, // { confId: '7', confName: '待核销' },
{ confId: '8', confName: '审核失败' }, // { confId: '8', confName: '已核销' },
{ confId: '9', confName: '待确认' }, { confId: '9', confName: '售后中' },
{ confId: '10', confName: '退款中' }, { confId: '10', confName: '售后完成' }
{ confId: '11', confName: '已退款' }, ]
{ confId: '12', confName: '退款失败' },
{ confId: '13', confName: '待发货' }, const afterSaleStatusList = [
{ confId: '14', confName: '待安装' }, { confId: '1', confName: '待审核' },
{ confId: '15', confName: '已安装' } { confId: '2', confName: '审核成功' },
{ confId: '3', confName: '审核失败' },
{ confId: '4', confName: '待确认' },
{ confId: '5', confName: '退款中' },
{ confId: '6', confName: '已退款' },
{ confId: '7', confName: '退款失败' },
] ]
const orderSourceList = [ const orderSourceList = [
{ confId: '1', confName: '商城订单' }, { confId: '1', confName: '商城订单' },
{ confId: '2', confName: '直播订单' }, { confId: '2', confName: '直播订单' },
{ confId: '3', confName: '活动订单' } { confId: '3', confName: '秒杀订单' }
] ]
const deliveryTypeList = [ const deliveryTypeList = [
...@@ -199,8 +204,9 @@ export { ...@@ -199,8 +204,9 @@ export {
limitPrice, limitPrice,
getExplorer, getExplorer,
exportFn, exportFn,
// aToExport, aToExport,
orderManageStatusList, orderManageStatusList,
afterSaleStatusList,
orderSourceList, orderSourceList,
deliveryTypeList, deliveryTypeList,
statusList, statusList,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="glsx-combi-form"> <div class="glsx-combi-form">
<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"> <template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px': '30px', ...item.style }" :label="item.label" :prop="item.name"> <el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :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 v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span> <span class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'"> <el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'">
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
{{ item.label }} {{ item.label }}
</span> </span>
<span v-else-if="!item.isHide && item.label" slot="label"> <span v-else-if="!item.isHide && item.label" slot="label">
<span class="combi-form-label" :style="{ width: item.labelWidth ? (item.labelWidth + labelPaddingRight) + 'px' : '', 'padding-right': isEdit ? '12px' : (labelPaddingRight + 'px') }">{{ item.label }}</span> <span class="combi-form-label" :style="{ width: item.labelWidth ? item.labelWidth + labelPaddingRight + 'px' : '', 'padding-right': isEdit ? '12px' : labelPaddingRight + 'px' }">{{ item.label }}</span>
</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'"> <div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" 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)" > <el-input :placeholder="item.placeholder || '请输入' + item.label" 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.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span> <span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input> </el-input>
...@@ -63,8 +64,8 @@ ...@@ -63,8 +64,8 @@
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h"> <div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h">
<div class="add" :style="{ top: item.maxPhotoNum == 1 ? '50%' : '40%' }">+</div> <div class="add" :style="{ top: item.maxPhotoNum == 1 ? '50%' : '40%' }">+</div>
<span v-if="item.maxPhotoNum > 1" class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span> <span v-if="item.maxPhotoNum > 1" class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span>
<input v-if="item.uploadType == 'video'" type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="video/mp4" @change="e => handleUploadChange(e, item)" /> <input v-if="item.uploadType == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" 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" accept="image/png, image/jpeg, image/gif, image/jpg" @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" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</div> </div>
</div> </div>
<template> <template>
...@@ -99,10 +100,10 @@ ...@@ -99,10 +100,10 @@
</template> </template>
<slot name="footer"></slot> <slot name="footer"></slot>
</el-form> </el-form>
<el-dialog v-if="isImgVisible" title="查看" :visible.sync="isImgVisible"> <el-dialog v-if="isImgVisible" title="查看" :visible.sync="isImgVisible" :close-on-click-modal="false">
<div class="dialog-look"> <div class="dialog-look">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls> <video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4"> <source :src="dialogObj.url" type="video/mp4" />
</video> </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> </div>
...@@ -160,7 +161,7 @@ export default { ...@@ -160,7 +161,7 @@ export default {
}, },
formObj: { formObj: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
hasTitle: { hasTitle: {
type: Boolean, type: Boolean,
...@@ -168,16 +169,16 @@ export default { ...@@ -168,16 +169,16 @@ export default {
}, },
formRules: { formRules: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
// 搜索+输入框/搜索组合组件,搜索栏绑值 // 搜索+输入框/搜索组合组件,搜索栏绑值
searchSelectObj: { searchSelectObj: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
mounted() {}, mounted() { },
methods: { methods: {
// 选择框-添加其他属性 // 选择框-添加其他属性
...@@ -353,7 +354,7 @@ export default { ...@@ -353,7 +354,7 @@ export default {
.glsx-combi-form .activity-img { .glsx-combi-form .activity-img {
position: relative; position: relative;
color: #999999; color: #999999;
background-color: #F7F7F7; background-color: #f7f7f7;
border: 1px dotted #d9d9d9; border: 1px dotted #d9d9d9;
cursor: pointer; cursor: pointer;
} }
...@@ -433,16 +434,16 @@ export default { ...@@ -433,16 +434,16 @@ export default {
/* 图片上传 */ /* 图片上传 */
.glsx-combi-form .el-tag.el-tag--info .el-tag__close { .glsx-combi-form .el-tag.el-tag--info .el-tag__close {
color: #E8E8EA; color: #e8e8ea;
background-color: #5850ff !important; background-color: #5850ff !important;
} }
.glsx-combi-form .el-tag.el-tag--info { .glsx-combi-form .el-tag.el-tag--info {
border-color: #5850ff; border-color: #5850ff;
} }
.glsx-combi-form .el-tag--plain.el-tag--info .el-tag__close:hover { .glsx-combi-form .el-tag--plain.el-tag--info .el-tag__close:hover {
background-color: #E8E8EA; background-color: #e8e8ea;
} }
.glsx-combi-form .el-tag.el-tag--info .el-tag__close:hover { .glsx-combi-form .el-tag.el-tag--info .el-tag__close:hover {
background-color: #E8E8EA; background-color: #e8e8ea;
} }
</style> </style>
...@@ -14,6 +14,7 @@ import selectMutiProDialog from '@/components/selectMutiProDialog/index.vue' ...@@ -14,6 +14,7 @@ import selectMutiProDialog from '@/components/selectMutiProDialog/index.vue'
import selectSingleProDialog from '@/components/selectSingleProDialog/index.vue' import selectSingleProDialog from '@/components/selectSingleProDialog/index.vue'
import relateStoreDialog from '@/components/relate-store-dialog' import relateStoreDialog from '@/components/relate-store-dialog'
import selectMutiProForcouponDialog from '@/components/selectMutiProDialog/indexForCoupon.vue' import selectMutiProForcouponDialog from '@/components/selectMutiProDialog/indexForCoupon.vue'
import tableTooltip from '@/components/table-tooltip/index.vue'
Vue.component('glsx-combi-form', glsxCombiForm) Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog) Vue.component('glsx-dialog', glsxDialog)
...@@ -21,3 +22,4 @@ Vue.component('select-muti-pro-dialog', selectMutiProDialog) ...@@ -21,3 +22,4 @@ Vue.component('select-muti-pro-dialog', selectMutiProDialog)
Vue.component('select-single-pro-dialog', selectSingleProDialog) Vue.component('select-single-pro-dialog', selectSingleProDialog)
Vue.component('relate-store-dialog', relateStoreDialog) Vue.component('relate-store-dialog', relateStoreDialog)
Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog) Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog)
Vue.component('table-tooltip', tableTooltip)
\ No newline at end of file \ No newline at end of file
...@@ -89,11 +89,11 @@ export default { ...@@ -89,11 +89,11 @@ export default {
}, },
mounted() { mounted() {
this.getList(true) this.getList({}, true)
}, },
methods: { methods: {
getList(isMounted = false) { getList(page, isMounted = false) {
var params = { var params = {
// goodsStatus: 1, // goodsStatus: 1,
// goodsSource: 1, // goodsSource: 1,
...@@ -103,7 +103,6 @@ export default { ...@@ -103,7 +103,6 @@ export default {
} }
var that = this var that = this
this.getListApi(params).then(res => { this.getListApi(params).then(res => {
// console.log(res)
this.productList = res.list this.productList = res.list
this.$refs.mutiProRef.tableTotal = res.total this.$refs.mutiProRef.tableTotal = res.total
this.recoverySelected() this.recoverySelected()
......
...@@ -100,11 +100,11 @@ export default { ...@@ -100,11 +100,11 @@ export default {
mounted() { mounted() {
this.userInfo = this.$globalState.session this.userInfo = this.$globalState.session
this.getList(true) this.getList({}, true)
}, },
methods: { methods: {
getList(isReset = false) { getList(page, isReset = false) {
var params = { var params = {
...this.searchForm, ...this.searchForm,
goodsStatus: 1, goodsStatus: 1,
......
...@@ -112,11 +112,11 @@ export default { ...@@ -112,11 +112,11 @@ export default {
mounted() { mounted() {
this.userInfo = this.$globalState.session this.userInfo = this.$globalState.session
this.getList(true) this.getList({}, true)
}, },
methods: { methods: {
getList(isMounted = false) { getList(page, isMounted = false) {
var params = { var params = {
goodsStatus: 1, goodsStatus: 1,
goodsSource: 1, goodsSource: 1,
...@@ -199,11 +199,11 @@ export default { ...@@ -199,11 +199,11 @@ export default {
this.$emit('handleMutiSelectClose') this.$emit('handleMutiSelectClose')
}, },
handleConfigSearch() { handleConfigSearch() {
this.getList(true) this.getList({}, true)
}, },
handleConfigReset() { handleConfigReset() {
this.searchProForm.name = '' this.searchProForm.name = ''
this.getList(true) this.getList({}, true)
} }
} }
} }
......
<template>
<div class="table-tooltip">
<el-popover
placement="top"
width="200"
trigger="hover"
:content="content"
>
<el-button
slot="reference"
icon="el-icon-warning"
circle
></el-button>
</el-popover>
</div>
</template>
<script>
export default {
name: 'table-tooltip',
props: {
content: {
type: String,
default: ''
}
},
}
</script>
<style scope>
.table-tooltip {
padding-right: 0 !important;
}
.table-tooltip .el-button {
border: none !important;
}
.table-tooltip .el-button.is-circle {
padding: 0 !important;
}
.table-tooltip .el-button:focus,
.table-tooltip .el-button:hover {
background-color: transparent;
}
.table-tooltip .el-button:focus {
color: initial;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -18,8 +18,9 @@ module.exports = { ...@@ -18,8 +18,9 @@ module.exports = {
code_message_map: {} code_message_map: {}
}, },
request: { request: {
// baseURL: 'http://scrm.test.glsx.com.cn/', baseURL: 'http://scrm.test.glsx.com.cn/',
baseURL: 'http://192.168.2.42:8064/', // baseURL: 'http://192.168.2.42:8064/',
// baseURL: 'http://scrm.dev.glsx.com.cn/',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* @version: * @version:
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: limin * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-09-07 14:38:52 * @LastEditTime: 2022-02-18 19:05:02
*/ */
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
...@@ -12,7 +12,6 @@ let cfg = require('./conf.js') ...@@ -12,7 +12,6 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function (isEnv = true) {
// console.log(1111111)
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
import Vue from 'vue' import Vue from 'vue'
import apis from './api' import apis from './api'
import './public-path' import './public-path'
import '@/assets/css/public.scss' // import '@/assets/css/public.scss'
import '@/components' import '@/components'
// import 'glsx-components/dist/glsx-components.css' // import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup' import { start } from '@/setup'
...@@ -20,4 +20,5 @@ Vue.prototype.size = 'small' ...@@ -20,4 +20,5 @@ Vue.prototype.size = 'small'
start() start()
export { bootstrap, mount, unmount } from '@/setup' export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
export const http2 = params => Vue.prototype.$http2(params)
export const http_common = params => Vue.prototype.$http_common(params) export const http_common = params => Vue.prototype.$http_common(params)
...@@ -207,5 +207,23 @@ const staticRoutes = Object.freeze([{ ...@@ -207,5 +207,23 @@ const staticRoutes = Object.freeze([{
component: resolve => require([`@/views/memberCenter/record.vue`], resolve), component: resolve => require([`@/views/memberCenter/record.vue`], resolve),
meta: {} meta: {}
}, },
{
name: 'giftBag',
path: '/giftBag/index',
component: resolve => require([`@/views/giftBag/index.vue`], resolve),
meta: {}
},
{
name: 'giftDetail',
path: '/giftBag/giftDetail',
component: resolve => require([`@/views/giftBag/giftDetail.vue`], resolve),
meta: {}
},
{
name: 'editGift',
path: '/giftBag/editGift',
component: resolve => require([`@/views/giftBag/editGift.vue`], resolve),
meta: {}
}
]) ])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
...@@ -10,3 +10,4 @@ ...@@ -10,3 +10,4 @@
import { bootstrap, mount, unmount } from './qiankun' import { bootstrap, mount, unmount } from './qiankun'
import { start } from './single' import { start } from './single'
export { bootstrap, mount, unmount, start } export { bootstrap, mount, unmount, start }
...@@ -4,6 +4,7 @@ import { fetchConfig } from '@/config' ...@@ -4,6 +4,7 @@ import { fetchConfig } from '@/config'
import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import '@/assets/css/public.scss'
import render from './render' import render from './render'
// import 'glsx-components/src/theme/theme.scss' // import 'glsx-components/src/theme/theme.scss'
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
...@@ -13,7 +14,7 @@ let instance = null ...@@ -13,7 +14,7 @@ let instance = null
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig() const { response, request, request2, sign, secret, sign_common, request_common } = await fetchConfig()
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
...@@ -21,6 +22,7 @@ export async function bootstrap({ history, common, messenger, globalState, route ...@@ -21,6 +22,7 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
// Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) // Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
...@@ -47,3 +49,4 @@ function subscribe({ messenger }) { ...@@ -47,3 +49,4 @@ function subscribe({ messenger }) {
console.log(`监听到子应用${v.from}发来消息:`, v) console.log(`监听到子应用${v.from}发来消息:`, v)
}) })
} }
...@@ -16,7 +16,7 @@ import render from './render' ...@@ -16,7 +16,7 @@ import render from './render'
import { routes } from '@/router' import { routes } from '@/router'
export async function start() { export async function start() {
if (window.__POWERED_BY_QIANKUN__) return if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig() const { response, request, sign, secret, request2 } = await fetchConfig()
var urlParams = {} var urlParams = {}
// window.location.href // window.location.href
// .split('?')[1] // .split('?')[1]
...@@ -24,8 +24,10 @@ export async function start() { ...@@ -24,8 +24,10 @@ export async function start() {
// .forEach(item => { // .forEach(item => {
// urlParams[item.split('=')[0]] = item.split('=')[1] // urlParams[item.split('=')[0]] = item.split('=')[1]
// }) // })
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : 'mini-53e870b5-80d5-483e-8277-cdc4dec0ad80-rop' var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : 'scrm-base-0958821a-6542-474e-b057-74a1192a25f2-rop'
Vue.prototype.$http2 = new Http({ response, request: request2, sign, secret, alert: message.error, headers: { token } })
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } }) Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
Vue.prototype.$common = { utils: utils }
render('/', routes) render('/', routes)
} }
const emoji = [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'],
['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹'],
]
export default emoji
\ No newline at end of file \ No newline at end of file
import { Message } from 'element-ui'
let util = {}
util.cloneText = function (message) {
let input = document.createElement('input')
input.value = message
document.body.appendChild(input)
input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input)
Message.success('复制成功')
}
util.getBeforeDate = function (sign = '-') {
let day = new Date();
let month = day.getMonth() + 1;
let date = day.getDate();
if (month < 10) month = '0' + month;
if (date < 10) date = '0' + date;
var s = day.getFullYear() + sign + month + sign + date;
return s;
}
util.getBeforeMonth = function (days) {
let month = new Date().getMonth() + 1;
let year = new Date().getFullYear();
let arr = new Array();
for (let i = 0; i < days; i++) {
if (month <= 0) {
year = year - 1;
month = month + 12;
}
if (month < 10) month = '0' + month;
arr[i] = year + '年' + month + '月'
month--
}
return arr;
}
/**
* 格式化时间
* @param {Array} time
*/
util.formatTime = function (time) {
return {
startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : ''
}
}
util.tringToDate = function (dateStr, separator) {
if (!separator) {
separator = "-";
}
var dateArr = dateStr.split(separator);
var year = parseInt(dateArr[0]);
var month;
//处理月份为04这样的情况
if (dateArr[1].indexOf("0") == 0) {
month = parseInt(dateArr[1].substring(1));
} else {
month = parseInt(dateArr[1]);
}
var day = parseInt(dateArr[2]);
var date = new Date(year, month - 1, day);
return date;
}
util.getDay = function (num, str = '-') {
var today = new Date();
var nowTime = today.getTime();
var ms = 24 * 3600 * 1000 * num;
today.setTime(parseInt(nowTime + ms));
var oYear = today.getFullYear();
var oMoth = (today.getMonth() + 1).toString();
if (oMoth.length <= 1) oMoth = '0' + oMoth;
var oDay = today.getDate().toString();
if (oDay.length <= 1) oDay = '0' + oDay;
return oYear + str + oMoth + str + oDay;
}
util.openUrl = function (url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
util.downloadIamge = function (imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image();
// 解决跨域 Canvas 污染问题
image.setAttribute("crossOrigin", "anonymous");
image.onload = function () {
var canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
var context = canvas.getContext("2d");
context.drawImage(image, 0, 0, image.width, image.height);
var url = canvas.toDataURL("image/png"); //得到图片的base64编码数据
var a = document.createElement("a"); // 生成一个a元素
var event = new MouseEvent("click"); // 创建一个单击事件
a.download = name || "photo"; // 设置图片名称
a.href = url; // 将生成的URL设置为a.href属性
a.dispatchEvent(event); // 触发a的单击事件
};
image.src = imgsrc;
}
export default util
\ No newline at end of file \ No newline at end of file
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<div slot="selectProBtn" slot-scope="scope" class="select-pro"> <div slot="selectProBtn" slot-scope="scope" class="select-pro">
<el-button type="default" @click="handleMutiProClose(scope)">{{ editForm.goodsRefList.length ? '更换商品' : '+选择商品' }}</el-button> <el-button type="default" @click="handleMutiProClose(scope)">{{ editForm.goodsRefList.length ? '更换商品' : '+选择商品' }}</el-button>
</div> </div>
<div slot="proTable" class="select-pro" style="padding-left: 20px;"> <div slot="proTable" class="select-pro" style="padding-left: 20px">
<GLTable v-show="editForm.goodsRefList.length" :hasPage="false" :tableParams="tableParams" :tableData="editForm.goodsRefList"> <GLTable v-show="editForm.goodsRefList.length" :hasPage="false" :tableParams="tableParams" :tableData="editForm.goodsRefList">
<template slot="goodsImage" slot-scope="scope"> <template slot="goodsImage" slot-scope="scope">
<img class="img-60" :src="scope.scope.goodsImage"/> <img class="img-60" :src="scope.scope.goodsImage" />
</template> </template>
<span slot="auth-button" slot-scope="scope"> <span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleProDelete(scope)">删除</el-button> <el-button type="text" @click="handleProDelete(scope)">删除</el-button>
...@@ -112,7 +112,7 @@ export default { ...@@ -112,7 +112,7 @@ export default {
prop: 'retailPrice' prop: 'retailPrice'
} }
] ]
}, }
} }
}, },
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
goodsImage: item.goods.goodsImage goodsImage: item.goods.goodsImage
}) })
}) })
this.$nextTick(()=>{ this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
}) })
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
this.$messageBox.confirm('是否删除该商品?', '删除', { this.$messageBox.confirm('是否删除该商品?', '删除', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'error', // type: 'error',
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
var idx = this.editForm.goodsRefList.findIndex(item => item.id == obj.scope.id) var idx = this.editForm.goodsRefList.findIndex(item => item.id == obj.scope.id)
...@@ -221,7 +221,8 @@ export default { ...@@ -221,7 +221,8 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { })
.then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => {})
......
...@@ -64,12 +64,15 @@ ...@@ -64,12 +64,15 @@
</el-form-item> </el-form-item>
</template> </template>
<template slot="useDescriptionHtml"> <template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear == 'couponSee'" /> <el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template>
<template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="apear != 'couponSee'" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
<el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button> <el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button>
<el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button> <el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button>
</div> </div>
...@@ -82,6 +85,8 @@ export default { ...@@ -82,6 +85,8 @@ export default {
name: 'editDiscountCoupon', name: 'editDiscountCoupon',
data() { data() {
return { return {
showSubmit: true,
userDisable: false,
size: 'small', size: 'small',
title: '创建', title: '创建',
titleObj: { titleObj: {
...@@ -121,9 +126,11 @@ export default { ...@@ -121,9 +126,11 @@ export default {
couponName: '', couponName: '',
effectiveType: '2', effectiveType: '2',
effectiveTime: [], effectiveTime: [],
effectiveDays: '' effectiveDays: '',
anticipatedCost: ''
}, },
editRule: { editRule: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }], couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }], effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }], effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
...@@ -140,6 +147,13 @@ export default { ...@@ -140,6 +147,13 @@ export default {
maxlength: 20 maxlength: 20
}, },
{ {
label: '预估成本/元',
name: 'anticipatedCost',
width: '320px',
type: 'input',
isDisabled: false
},
{
label: '发放数量', label: '发放数量',
name: 'stock', name: 'stock',
width: '180px', width: '180px',
...@@ -155,6 +169,11 @@ export default { ...@@ -155,6 +169,11 @@ export default {
label: '使用说明', label: '使用说明',
name: 'useDescription', name: 'useDescription',
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
},
{
name: '',
addHtml: 'editHtml',
isHide: true
} }
] ]
} }
...@@ -171,7 +190,9 @@ export default { ...@@ -171,7 +190,9 @@ export default {
if (id) { if (id) {
if (addOrEdit == 3) { if (addOrEdit == 3) {
this.apear = 'couponSee' this.apear = 'couponSee'
this.showSubmit = false
this.title = '查看' this.title = '查看'
this.editFormData[5].isHide = false
} else if (addOrEdit == 2) { } else if (addOrEdit == 2) {
this.apear = 'couponEdit' this.apear = 'couponEdit'
this.title = '编辑' this.title = '编辑'
...@@ -179,6 +200,8 @@ export default { ...@@ -179,6 +200,8 @@ export default {
this.isDisabled = true this.isDisabled = true
this.editFormData[0].isDisabled = this.isDisabled this.editFormData[0].isDisabled = this.isDisabled
this.editFormData[1].isDisabled = this.isDisabled this.editFormData[1].isDisabled = this.isDisabled
this.editFormData[2].isDisabled = this.isDisabled
this.userDisable = true
} else { } else {
this.apear = 'couponAdd' this.apear = 'couponAdd'
this.title = '创建' this.title = '创建'
...@@ -196,6 +219,9 @@ export default { ...@@ -196,6 +219,9 @@ export default {
'editForm.effectiveDays'(newValue, oldValue) { 'editForm.effectiveDays'(newValue, oldValue) {
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0) this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0)
}, },
'editForm.anticipatedCost'(newValue, oldValue) {
this.editForm.anticipatedCost = limitPrice(newValue, oldValue, 4, 2, 0, 10000)
},
'editForm.stock'(newValue, oldValue) { 'editForm.stock'(newValue, oldValue) {
this.editForm.stock = limitPrice(newValue, oldValue, 6, 0, 1) this.editForm.stock = limitPrice(newValue, oldValue, 6, 0, 1)
}, },
...@@ -216,6 +242,13 @@ export default { ...@@ -216,6 +242,13 @@ export default {
}, },
methods: { methods: {
// 编辑按钮
editMessage() {
let anticipatedCostIndex = this.editFormData.findIndex(item => item.name == 'anticipatedCost')
this.editFormData[anticipatedCostIndex].isDisabled = false
this.userDisable = false
this.showSubmit = true
},
setDateString(objField, special) { setDateString(objField, special) {
var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日') var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日')
return value return value
...@@ -225,13 +258,13 @@ export default { ...@@ -225,13 +258,13 @@ export default {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => { this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
this.editForm = this.$common.utils.deepClone(res) this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveType = this.editForm.effectiveType + '' this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime] this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
} }
this.$nextTick(()=>{ this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
}) })
...@@ -265,7 +298,7 @@ export default { ...@@ -265,7 +298,7 @@ export default {
obj.couponName = form.couponName obj.couponName = form.couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务 //优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj.discountType = '2' obj.discountType = '2'
obj.directionalFlag = '1'
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj.effectiveType = form.effectiveType obj.effectiveType = form.effectiveType
...@@ -290,6 +323,8 @@ export default { ...@@ -290,6 +323,8 @@ export default {
} }
//使用描述 //使用描述
obj.useDescription = form.useDescription obj.useDescription = form.useDescription
//预估成本
obj.anticipatedCost = form.anticipatedCost * 100
return obj return obj
}, },
...@@ -327,7 +362,8 @@ export default { ...@@ -327,7 +362,8 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { })
.then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => {})
......
<!-- 编辑兑换券 --> <!-- 编辑兑换券 -->
<template> <template>
<div class="edit-share marketing p-t-20 edit-box"> <div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container" style="height: 630px;position: relative;"> <div class="container edit-container" style="height: 630px; position: relative">
<div class="right_show"> <div class="right_show">
<div class="card-top"></div> <div class="card-top"></div>
<div class="card_one"> <div class="card_one">
...@@ -29,26 +29,29 @@ ...@@ -29,26 +29,29 @@
<p class="edit-title">{{ title }}兑换券</p> <p class="edit-title">{{ title }}兑换券</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px;display: block;"> <el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" type="daterange" style="width:295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker> <el-date-picker v-model="editForm.effectiveTime" type="daterange" style="width: 295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio> </el-radio>
</el-form-item> </el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays"> <el-form-item prop="effectiveDays" ref="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'">
领取后 领取后
<el-input v-model="editForm.effectiveDays" style="width: 100px;margin-left:5px;margin-right:5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" /> <el-input v-model="editForm.effectiveDays" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" />
天内有效 天内有效
</el-radio> </el-radio>
</el-form-item> </el-form-item>
</template> </template>
<template slot="useDescriptionHtml"> <template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear == 'couponSee'" /> <el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template>
<template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="apear != 'couponSee'" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
<el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button> <el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button>
<el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button> <el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button>
</div> </div>
...@@ -61,6 +64,8 @@ export default { ...@@ -61,6 +64,8 @@ export default {
name: 'editDiscountCoupon', name: 'editDiscountCoupon',
data() { data() {
return { return {
showSubmit: true,
userDisable: false,
size: 'small', size: 'small',
title: '创建', title: '创建',
titleObj: { titleObj: {
...@@ -100,9 +105,11 @@ export default { ...@@ -100,9 +105,11 @@ export default {
couponName: '', couponName: '',
effectiveType: '2', effectiveType: '2',
effectiveTime: [], effectiveTime: [],
effectiveDays: '' effectiveDays: '',
anticipatedCost: ''
}, },
editRule: { editRule: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }], couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }], effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }], effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
...@@ -119,6 +126,13 @@ export default { ...@@ -119,6 +126,13 @@ export default {
maxlength: 20 maxlength: 20
}, },
{ {
label: '预估成本/元',
name: 'anticipatedCost',
width: '320px',
type: 'input',
isDisabled: false
},
{
label: '发放数量', label: '发放数量',
name: 'stock', name: 'stock',
width: '180px', width: '180px',
...@@ -134,6 +148,11 @@ export default { ...@@ -134,6 +148,11 @@ export default {
label: '使用说明', label: '使用说明',
name: 'useDescription', name: 'useDescription',
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
},
{
name: '',
addHtml: 'editHtml',
isHide: true
} }
] ]
} }
...@@ -150,6 +169,8 @@ export default { ...@@ -150,6 +169,8 @@ export default {
if (id) { if (id) {
if (addOrEdit == 3) { if (addOrEdit == 3) {
this.apear = 'couponSee' this.apear = 'couponSee'
this.editFormData[5].isHide = false
this.showSubmit = false
this.title = '查看' this.title = '查看'
} else if (addOrEdit == 2) { } else if (addOrEdit == 2) {
this.apear = 'couponEdit' this.apear = 'couponEdit'
...@@ -158,6 +179,7 @@ export default { ...@@ -158,6 +179,7 @@ export default {
this.isDisabled = true this.isDisabled = true
this.editFormData[0].isDisabled = this.isDisabled this.editFormData[0].isDisabled = this.isDisabled
this.editFormData[1].isDisabled = this.isDisabled this.editFormData[1].isDisabled = this.isDisabled
this.userDisable = true
} else { } else {
this.apear = 'couponAdd' this.apear = 'couponAdd'
this.title = '创建' this.title = '创建'
...@@ -172,6 +194,9 @@ export default { ...@@ -172,6 +194,9 @@ export default {
}, },
deep: true deep: true
}, },
'editForm.anticipatedCost'(newValue, oldValue) {
this.editForm.anticipatedCost = limitPrice(newValue, oldValue, 4, 2, 0, 10000)
},
'editForm.effectiveDays'(newValue, oldValue) { 'editForm.effectiveDays'(newValue, oldValue) {
this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0) this.editForm.effectiveDays = limitPrice(newValue, oldValue, 3, 0)
}, },
...@@ -195,6 +220,13 @@ export default { ...@@ -195,6 +220,13 @@ export default {
}, },
methods: { methods: {
// 编辑按钮
editMessage() {
let anticipatedCostIndex = this.editFormData.findIndex(item => item.name == 'anticipatedCost')
this.editFormData[anticipatedCostIndex].isDisabled = false
this.userDisable = false
this.showSubmit = true
},
setDateString(objField, special) { setDateString(objField, special) {
var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日') var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日')
return value return value
...@@ -204,13 +236,13 @@ export default { ...@@ -204,13 +236,13 @@ export default {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => { this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
this.editForm = this.$common.utils.deepClone(res) this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveType = this.editForm.effectiveType + '' this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime] this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
} }
this.$nextTick(()=>{ this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
}) })
...@@ -244,7 +276,7 @@ export default { ...@@ -244,7 +276,7 @@ export default {
obj.couponName = form.couponName obj.couponName = form.couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务 //优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj.discountType = '4' obj.discountType = '4'
obj.directionalFlag = '1'
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj.effectiveType = form.effectiveType obj.effectiveType = form.effectiveType
...@@ -269,6 +301,8 @@ export default { ...@@ -269,6 +301,8 @@ export default {
} }
//使用描述 //使用描述
obj.useDescription = form.useDescription obj.useDescription = form.useDescription
//预估成本
obj.anticipatedCost = form.anticipatedCost * 100
return obj return obj
}, },
...@@ -306,7 +340,8 @@ export default { ...@@ -306,7 +340,8 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { })
.then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => {})
......
...@@ -7,15 +7,15 @@ ...@@ -7,15 +7,15 @@
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio> <el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio>
<br /> <br />
<el-form-item prop="effectiveTime" style="margin-top: 12px;display: block;"> <el-form-item prop="effectiveTime" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" type="daterange" style="width:295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker> <el-date-picker v-model="editForm.effectiveTime" type="daterange" style="width: 295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio> </el-radio>
</el-form-item> </el-form-item>
<el-form-item prop="effectiveDays"> <el-form-item prop="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'">
领取后 领取后
<el-input v-model="editForm.effectiveDays" style="width: 100px;margin-left:5px;margin-right:5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" /> <el-input v-model="editForm.effectiveDays" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" />
天内有效 天内有效
</el-radio> </el-radio>
</el-form-item> </el-form-item>
...@@ -23,21 +23,21 @@ ...@@ -23,21 +23,21 @@
<template slot="useTypeHtml"> <template slot="useTypeHtml">
<el-radio v-model="editForm.useType" label="0" :disabled="apear != 'couponAdd'">无限制</el-radio> <el-radio v-model="editForm.useType" label="0" :disabled="apear != 'couponAdd'">无限制</el-radio>
<br /> <br />
<el-form-item prop="usageTimes" style="margin-top: 12px;display: block;"> <el-form-item prop="usageTimes" style="margin-top: 12px; display: block">
<el-radio v-model="editForm.useType" label="1" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.useType" label="1" :disabled="apear != 'couponAdd'">
有效期内可使用 有效期内可使用
<el-input v-model="editForm.usageTimes" style="width: 100px;margin-left:5px;margin-right:5px" :disabled="apear != 'couponAdd' || editForm.useType != 1" /> <el-input v-model="editForm.usageTimes" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.useType != 1" />
次 次
</el-radio> </el-radio>
</el-form-item> </el-form-item>
<el-radio v-model="editForm.useType" label="2" :disabled="apear != 'couponAdd'"> <el-radio v-model="editForm.useType" label="2" :disabled="apear != 'couponAdd'">
<el-form-item prop="useLimitDays"> <el-form-item prop="useLimitDays">
有效期内 有效期内
<el-input v-model="editForm.useLimitDays" style="width: 100px;margin-left:5px;margin-right:5px" :disabled="apear != 'couponAdd' || editForm.useType != 2" /> <el-input v-model="editForm.useLimitDays" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.useType != 2" />
天可使用 天可使用
</el-form-item> </el-form-item>
<el-form-item prop="usageTimes2"> <el-form-item prop="usageTimes2">
<el-input v-model="editForm.usageTimes2" style="width: 100px;margin-right:5px" :disabled="apear != 'couponAdd' || editForm.useType != 2" /> <el-input v-model="editForm.usageTimes2" style="width: 100px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.useType != 2" />
次 次
</el-form-item> </el-form-item>
</el-radio> </el-radio>
......
...@@ -121,15 +121,31 @@ export default { ...@@ -121,15 +121,31 @@ export default {
{ {
label: '优惠券类型', label: '优惠券类型',
name: 'discountType', name: 'discountType',
width: '100px',
formatter: cellValue => { formatter: cellValue => {
return this.baseData.discountTypeList.find(item => item.confId == cellValue.discountType).confName return this.baseData.discountTypeList.find(item => item.confId == cellValue.discountType).confName
} }
}, },
{ {
label: '预估成本/元',
prop: 'anticipatedCost ',
formatter: cellValue => {
return cellValue.anticipatedCost / 100
}
},
{
label: '已领取', label: '已领取',
prop: 'getAmount' prop: 'getAmount'
}, },
{ {
label: '已核销',
prop: 'usedAmount'
},
{
label: '未核销',
prop: 'unUsedAmount'
},
{
label: '剩余', label: '剩余',
prop: 'residueAmount' prop: 'residueAmount'
}, },
...@@ -147,6 +163,7 @@ export default { ...@@ -147,6 +163,7 @@ export default {
{ {
label: '优惠券状态', label: '优惠券状态',
name: 'status', name: 'status',
width: '100px',
formatter: cellValue => { formatter: cellValue => {
return this.baseData.statusList.find(item => item.confId == cellValue.status).confName return this.baseData.statusList.find(item => item.confId == cellValue.status).confName
} }
......
<template> <template>
<div class="ly-emotion" > <div class="ly-emotion">
<slot></slot> <slot></slot>
</div> </div>
</template> </template>
<script> <script>
import emoji from '@/utils/emo'
export default { export default {
name: 'ly-emotion', name: 'ly-emotion',
mounted () { mounted() {
const name = this.$el.innerHTML const name = this.$el.innerHTML
const list = ['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴', '睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过', '酷', '冷汗', '抓狂', '吐', '偷笑', '可爱', '白眼', '傲慢', '饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂', '疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见', '擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠', '鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀', '西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰', '凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀', '足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强', '弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你', 'NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈', '磕头', '回头', '跳绳', '挥手', '激动', '街舞', '献吻', '左太极', '右太极'] const list = emoji.flat(Infinity)
let index = list.indexOf(name) let index = parseInt(list.indexOf(name)) + 1
let imgHTML = `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif">` if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
let imgHTML = `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
this.$nextTick(() => { this.$nextTick(() => {
this.$el.innerHTML = imgHTML this.$el.innerHTML = imgHTML
}) })
}, }
} }
</script> </script>
<style scoped> <style scoped>
.ly-emotion { .ly-emotion {
display: inline-block display: inline-block;
} }
.ly-static-emotion { .ly-static-emotion {
width: 24px; width: 24px;
......
...@@ -2,13 +2,19 @@ ...@@ -2,13 +2,19 @@
<div> <div>
<div class="emotion-box" :style="{ height: height + 'px' }"> <div class="emotion-box" :style="{ height: height + 'px' }">
<div class="emotion-box-line" v-for="(line, i) in list" :key="i"> <div class="emotion-box-line" v-for="(line, i) in list" :key="i">
<emotion class="emotion-item" v-for="(item, i) in line" :key="i" @click.native="clickHandler(item)">{{ item }}</emotion> <emotion
class="emotion-item"
v-for="(item, i) in line"
:key="i"
@click.native="clickHandler(item)"
>{{ item }}</emotion>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import emoji from '@/utils/emo'
import Emotion from './Emotion' import Emotion from './Emotion'
export default { export default {
props: { props: {
...@@ -19,19 +25,7 @@ export default { ...@@ -19,19 +25,7 @@ export default {
}, },
data() { data() {
return { return {
list: [ list: emoji
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '挥手', '激动', '街舞', '左太极', '右太极']
]
} }
}, },
methods: { methods: {
...@@ -64,9 +58,13 @@ export default { ...@@ -64,9 +58,13 @@ export default {
flex: 1; flex: 1;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
line-height: 23px;
/deep/ { /deep/ {
img { img {
width: 24px; width: 24px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
} }
} }
} }
......
...@@ -11,7 +11,24 @@ ...@@ -11,7 +11,24 @@
<div class="preview-activity"> <div class="preview-activity">
<!-- <img class="applet-logo" src="@/assets/guestCustom/applet-logo.png" alt /> --> <!-- <img class="applet-logo" src="@/assets/guestCustom/applet-logo.png" alt /> -->
<div class="activity-name">{{item.attContent.marketingName}}</div> <div class="activity-name">{{item.attContent.marketingName}}</div>
<img class="activity-logo" src="@/assets/guestCustom/activity-logo.png" alt /> <img
v-if="item.attContent.marketingType != 5 && item.attContent.marketingType != 6"
class="activity-logo"
src="@/assets/guestCustom/activity-logo.png"
alt
/>
<img
v-if="item.attContent.marketingType == 5"
class="activity-logo"
src="@/assets/guestCustom/activity-spike.png"
alt
/>
<img
v-if="item.attContent.marketingType == 6"
class="activity-logo"
src="@/assets/guestCustom/activity-service.png"
alt
/>
<div class="activity-footer"> <div class="activity-footer">
<img src="@/assets/guestCustom/applet-footer.png" alt /> <img src="@/assets/guestCustom/applet-footer.png" alt />
</div> </div>
...@@ -43,6 +60,7 @@ ...@@ -43,6 +60,7 @@
</template> </template>
<script> <script>
import emoji from '@/utils/emo'
export default { export default {
name: 'Preview', name: 'Preview',
props: { eventBus: Object }, props: { eventBus: Object },
...@@ -56,117 +74,16 @@ export default { ...@@ -56,117 +74,16 @@ export default {
previewList(val) { previewList(val) {
if (val.length && val[0].attType == 1) { if (val.length && val[0].attType == 1) {
const attContent = val[0].attContent const attContent = val[0].attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA5]{1,3}]/gi, function(res) { const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = [ const list = emoji.flat(Infinity)
'微笑', let index = parseInt(list.indexOf(word)) + 1
'撇嘴', if (index < 10) {
'色', index = '00' + index
'发呆', } else if (index >= 10 && index < 100) {
'得意', index = '0' + index
'流泪', }
'害羞', return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
let index = list.indexOf(word)
return `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif">`
}) })
val[0].attContent = htm val[0].attContent = htm
} }
...@@ -224,6 +141,11 @@ export default { ...@@ -224,6 +141,11 @@ export default {
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
word-wrap: break-word; word-wrap: break-word;
display: flex;
img {
width: 20px;
height: 20px;
}
} }
.text { .text {
font-size: 16px; font-size: 16px;
......
<template>
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
预选
<span>共{{ chatGroupCount }}个群聊,{{ tableEmpData.length }}个群主成员</span>
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item style="margin-bottom: 0">
<span class="lord-label" slot="label">所在门店/部门</span>
<el-popover ref="popover" placement="bottom" width="215" trigger="click" v-model="popoverVisible" @show="onShowPopover" @hide="onHidePopover">
<el-tree class="select-tree" :data="treeData" :props="defaultProps" default-expand-all @node-click="handleNodeClick"></el-tree>
<el-input v-model="searchForm.department" slot="reference" :size="size" readonly style="width: 215px" placeholder="请选择所在门店/部门" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" @keyup.enter.native="search"></el-input>
</el-popover>
</el-form-item>
<el-form-item label="姓名" style="margin-bottom: 0">
<el-input :size="size" v-model.trim="searchForm.lordName" @keyup.enter.native="search" clearable placeholder="请输入姓名搜索"></el-input>
</el-form-item>
<el-form-item style="margin-bottom: 0">
<span class="lord-label" slot="label">跟进专员类型</span>
<el-select v-model="searchForm.followerId" style="width: 215px" :size="size" placeholder="请选择">
<el-option v-for="item in followTypeList" :key="item.id" :label="item.followName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item>
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</el-form-item>-->
<el-form-item label style="margin-bottom: 0; margin-left: 40px">
<el-button :size="size" @click="handleReset">重置</el-button>
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
<div class="table-content" style="max-height: 456px">
<GLTable v-loading="loading" ref="empTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick">
<div slot="staffName" slot-scope="scope">
<span>{{ scope.scope.staffName }}</span>
<span class="staff-title" v-show="scope.scope.staffTitle">{{ scope.scope.staffTitle }}</span>
</div>
</GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<div class="member-name">成员名称({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'SelectLord',
props: ['selectData'],
data() {
return {
url: url,
searchForm: {},
checked: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
popoverVisible: false,
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName',
addHtml: 'staffName'
},
{
label: '所在门店/部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerTypeName',
formatter: cellValue => {
return cellValue.followerTypeName ? cellValue.followerTypeName : '-'
}
},
{
label: '群数量',
prop: 'chatCount'
}
]
},
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: [],
followTypeList: [],
chatGroupCount: 0
}
},
mounted() {
this.getFindLordGroup({}, true)
this.getFollowerType()
this.listDepartmentTree()
},
methods: {
selectionTable(val) {
this.innerTags = val
},
// 清空搜索条件
resetSearch() {
this.searchForm = {}
this.tableEmpData = this.allTreeData
},
// 显示时触发
onShowPopover() {
this.popoverVisible = true
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
getFindLordGroup(params, isFirst) {
this.$apis.customerTransform.findLordGroup(params).then(res => {
this.loading = false
if (res) {
this.tableEmpData = res
this.tableEmpData.map(item => (this.chatGroupCount += item.chatCount))
this.$refs.empTable.tableHeightValues = this.tableEmpData.length ? '' : '230px'
if (isFirst && this.selectData && this.selectData.length) {
this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
})
}
} else {
this.treeData = []
}
})
},
listDepartmentTree() {
const params = { addChildrensFlag: true }
params.islord = true
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
this.treeData = res
})
},
handleNodeClick(data) {
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
getEmployee(d, arr = []) {
d.reverse().forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
search() {
this.getFindLordGroup(this.searchForm)
},
remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
getFollowerType() {
this.$apis.customerTransform.followerType({}).then(res => {
this.followTypeList = res
})
},
handleReset() {
this.searchForm = {}
this.search()
}
}
}
</script>
<style lang="scss">
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.staff-title {
position: relative;
font-size: 12px;
padding: 0 10px;
line-height: 12px;
color: #999;
&::before {
content: '';
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
display: inline-block;
width: 1px;
height: 12px;
background-color: #999;
}
}
.lord-label {
display: inline-block;
width: 110px;
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 600;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-weight: 500;
}
}
.member-left {
width: 800px;
.member-content {
border: 1px solid #eee;
border-bottom: none;
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
}
</style>
<!-- 树形搜索 -->
<template>
<div>
<el-popover
ref="popover"
placement="bottom-start"
trigger="click"
v-model="popoverVisible"
:disabled="targetItem.isDisabled"
@show="onShowPopover"
@hide="onHidePopover"
>
<el-tree
ref="tree"
class="select-tree"
highlight-current
default-expand-all
node-key="id"
:expand-on-click-node="isExpand"
:style="`min-width: ${treeWidth}`"
:data="treeData"
:current-node-key="form[targetItem.name]"
:props="defaultProps"
:filter-node-method="handleFilterNode"
@current-change="handleNodeClick"
></el-tree>
<el-input
slot="reference"
ref="input"
v-model="form[targetItem.nameLabel]"
clearable
:disabled="targetItem.isDisabled"
:style="`width: ${width}px`"
:class="{ 'rotate': popoverVisible }"
suffix-icon="el-icon-arrow-down"
:placeholder="'请选择' + targetItem.label"
@change="handleClear"
></el-input>
</el-popover>
</div>
</template>
<script>
export default {
name: 'SelectTree',
data() {
return {
isExpand: false,
// 树状菜单显示状态
popoverVisible: false,
treeWidth: 'auto'
}
},
props: {
// 输入框宽度
width: String,
form: {
type: Object,
default: () => {}
},
targetItem: {
type: Object,
default: () => {}
},
treeData: {
type: Array,
default: () => []
},
defaultProps: {
type: Object,
default: () => ({
parent: 'parentId',
value: 'id',
label: 'menuName',
children: 'childlist'
})
}
},
watch: {
form(val) {
if (this.form[this.targetItem.name]) {
this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
this.$nextTick().then(() => {
this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
})
}
}
},
created() {
// 获取输入框宽度同步至树状菜单宽度
this.$nextTick(() => {
this.treeWidth = `${(this.width || this.$refs.input.$refs.input.clientWidth) - 24}px`
})
},
mounted() {
if (this.form[this.targetItem.name]) {
// console.log(this.treeData)
// console.log(this.form)
this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
this.$nextTick().then(() => {
this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
})
}
},
methods: {
// 显示时触发
onShowPopover() {
this.popoverVisible = true
this.$refs.tree.filter(false)
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
// 树节点过滤方法
handleFilterNode(query, data) {
if (!query) return true
return data[this.defaultProps.label].indexOf(query) !== -1
},
handleNodeClick(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
this.onHidePopover()
},
handleClear(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
window.event.stopPropagation()
},
// 搜索树状数据中的 ID
queryTree(tree, id) {
let stark = []
stark = stark.concat(tree)
while (stark.length) {
const temp = stark.shift()
if (temp[this.defaultProps.children]) {
stark = stark.concat(temp[this.defaultProps.children])
}
if (temp[this.defaultProps.value] === id) {
return temp[this.defaultProps.label]
}
}
return
}
}
}
</script>
<style>
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
</template> </template>
<script> <script>
import emoji from '@/utils/emo'
export default { export default {
name: 'wTextarea', name: 'wTextarea',
data() { data() {
...@@ -228,121 +229,16 @@ export default { ...@@ -228,121 +229,16 @@ export default {
this.updateData(target.innerHTML) this.updateData(target.innerHTML)
} }
let htm = target.innerHTML let htm = target.innerHTML
const list = [ const list = emoji.flat(Infinity)
'微笑', const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
'撇嘴', const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
'色', let s = list[parseInt(str.split('.')[0]) - 1]
'发呆',
'得意',
'流泪',
'害羞',
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
const cutImg = htm.replaceAll('<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/', '')
const replaceImg = cutImg.replace(/(\d){1,2}.gif">/g, function(str) {
let s = list[str.split('.')[0]]
return `[${s}]` return `[${s}]`
}) })
console.log(replaceImg)
let Textnode = document.createElement('div') let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText this.currentText = Textnode.innerText.substring(0, 600)
this.$emit('updateText', this.currentText) this.$emit('updateText', this.currentText)
}, },
placeCaretAtEnd(el) { placeCaretAtEnd(el) {
...@@ -366,121 +262,16 @@ export default { ...@@ -366,121 +262,16 @@ export default {
// 即时更新数据 // 即时更新数据
this.updateData(target.innerHTML) this.updateData(target.innerHTML)
let htm = target.innerHTML let htm = target.innerHTML
const list = [ console.log(htm)
'微笑', const list = emoji.flat(Infinity)
'撇嘴', const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
'色', const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
'发呆', let s = list[parseInt(str.split('.')[0]) - 1]
'得意',
'流泪',
'害羞',
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
const cutImg = htm.replaceAll('<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/', '')
const replaceImg = cutImg.replace(/(\d){1,2}.gif">/g, function(str) {
let s = list[str.split('.')[0]]
return `[${s}]` return `[${s}]`
}) })
let Textnode = document.createElement('div') let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText this.currentText = Textnode.innerText.substring(0, 600)
this.$emit('updateText', this.currentText) this.$emit('updateText', this.currentText)
}, },
handleDelete(e) { handleDelete(e) {
...@@ -582,6 +373,7 @@ $textColor: #666; ...@@ -582,6 +373,7 @@ $textColor: #666;
position: relative; position: relative;
&_input { &_input {
width: 100%; width: 100%;
height: 200px;
min-height: 100px; min-height: 100px;
box-sizing: border-box; box-sizing: border-box;
padding: 10px; padding: 10px;
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
</div> </div>
</div> </div>
<ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel> <ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel>
<MessageModel ref="message" @selectItem="selectMessage"></MessageModel>
</div> </div>
</template> </template>
<script> <script>
...@@ -105,8 +106,9 @@ const ATT_TYPE = { ...@@ -105,8 +106,9 @@ const ATT_TYPE = {
FILE: 6, FILE: 6,
ACTIVITY: 7 ACTIVITY: 7
} }
// import E from 'wangeditor' import emoji from '@/utils/emo'
import ActivityModel from './activityModel' import ActivityModel from './activityModel'
import MessageModel from './messageModel'
import Emotion from './emotionWords' import Emotion from './emotionWords'
import wTextarea from './tag-textarea' import wTextarea from './tag-textarea'
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
...@@ -115,7 +117,8 @@ export default { ...@@ -115,7 +117,8 @@ export default {
components: { components: {
ActivityModel, ActivityModel,
Emotion, Emotion,
wTextarea wTextarea,
MessageModel
}, },
props: { eventBus: Object, btnList: Array, form: String }, props: { eventBus: Object, btnList: Array, form: String },
data() { data() {
...@@ -182,115 +185,14 @@ export default { ...@@ -182,115 +185,14 @@ export default {
}, },
handleEmotion(i) { handleEmotion(i) {
this.emotionStatus = false this.emotionStatus = false
const list = [ const list = emoji.flat(Infinity)
'微笑', let index = list.indexOf(i) + 1
'撇嘴', if (index < 10) {
'色', index = '00' + index
'发呆', } else if (index >= 10 && index < 100) {
'得意', index = '0' + index
'流泪', }
'害羞', this.$refs.textContent.addImg(`https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png`)
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
let index = list.indexOf(i)
this.$refs.textContent.addImg(`https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif`)
}, },
updateText(val) { updateText(val) {
this.textInput(val) this.textInput(val)
...@@ -362,6 +264,8 @@ export default { ...@@ -362,6 +264,8 @@ export default {
this.$refs.textContent.addTag('@昵称') this.$refs.textContent.addTag('@昵称')
} else if (name == 'activity') { } else if (name == 'activity') {
this.$refs.activity.init() this.$refs.activity.init()
} else if (name == 'message') {
this.$refs.message.init()
} }
}, },
close(index) { close(index) {
...@@ -370,6 +274,7 @@ export default { ...@@ -370,6 +274,7 @@ export default {
}, },
textInput(val) { textInput(val) {
const hasText = this.previewList.some(item => item.attType == 1) const hasText = this.previewList.some(item => item.attType == 1)
if (val) {
if (hasText) { if (hasText) {
this.$set(this.previewList, 0, { this.$set(this.previewList, 0, {
attContent: val, attContent: val,
...@@ -381,6 +286,9 @@ export default { ...@@ -381,6 +286,9 @@ export default {
attType: ATT_TYPE.TEXT attType: ATT_TYPE.TEXT
}) })
} }
} else {
this.previewList.splice(0)
}
}, },
selectActivity(val) { selectActivity(val) {
let idx let idx
...@@ -404,6 +312,16 @@ export default { ...@@ -404,6 +312,16 @@ export default {
} }
} }
}, },
selectMessage(val) {
console.log(val)
const content = val.content
this.updateText(content)
this.textValue = content
// this.previewList[0] = {
// attContent: content,
// attType: ATT_TYPE.TEXT
// }
},
insertHtmlAtCaret(html) { insertHtmlAtCaret(html) {
var sel, range, frag var sel, range, frag
if (window.getSelection) { if (window.getSelection) {
...@@ -445,122 +363,21 @@ export default { ...@@ -445,122 +363,21 @@ export default {
this.textInput(str) this.textInput(str)
}, 300), }, 300),
updateList(val) { updateList(val) {
console.log(val)
this.previewList = val this.previewList = val
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
const obj = val.find(item => item.attType == 1) const obj = val.find(item => item.attType == 1)
// let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>') let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>')
let attContent = obj.attContent const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
const htm = attContent.replace(/\[[\u4E00-\u9FA5]{1,3}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = [ const list = emoji.flat(Infinity)
'微笑', let index = parseInt(list.indexOf(word)) + 1
'撇嘴', if (index < 10) {
'色', index = '00' + index
'发呆', } else if (index >= 10 && index < 100) {
'得意', index = '0' + index
'流泪', }
'害羞', return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
let index = list.indexOf(word)
return `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif">`
}) })
document.querySelector('.w-textarea_input').focus() document.querySelector('.w-textarea_input').focus()
setTimeout(() => { setTimeout(() => {
......
...@@ -3,13 +3,15 @@ ...@@ -3,13 +3,15 @@
<BasicInof :form="'customerGroup'" :eventBus="eventBus" :id="$route.params.id"></BasicInof> <BasicInof :form="'customerGroup'" :eventBus="eventBus" :id="$route.params.id"></BasicInof>
<div class="group-detail-container"> <div class="group-detail-container">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData"> <glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="search-btns"> <div slot="footer" class="search-btns">
<el-button :size="size" @click="update">更新</el-button>
<el-button :size="size" @click="handleReset">重置</el-button> <el-button :size="size" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span> </div>
</glsx-combi-form> </glsx-combi-form>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable <GLTable
style="margin-top: 20px;"
ref="table" ref="table"
:getListApi="getListApi" :getListApi="getListApi"
:searchForm="searchForm" :searchForm="searchForm"
...@@ -20,7 +22,7 @@ ...@@ -20,7 +22,7 @@
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button <el-button
type="text" type="text"
:disabled="scope.scope.remindStatus == 1" :disabled="scope.scope.status == 1 || (scope.scope.status == 0 && scope.scope.remindStatus == 1)"
@click="remind(scope.scope)" @click="remind(scope.scope)"
>提醒发送</el-button> >提醒发送</el-button>
</div> </div>
...@@ -33,7 +35,6 @@ ...@@ -33,7 +35,6 @@
width: footerWidth + 'px' width: footerWidth + 'px'
}" }"
> >
<!-- <el-button type="primary" @click="handleNext">确定</el-button> -->
<el-button type="primary" @click="handleCancel">取消</el-button> <el-button type="primary" @click="handleCancel">取消</el-button>
</div> </div>
</div> </div>
...@@ -185,6 +186,15 @@ export default { ...@@ -185,6 +186,15 @@ export default {
this.$apis.customerTransform.customerDetail({ id }).then(res => { this.$apis.customerTransform.customerDetail({ id }).then(res => {
this.searchFormData[1].optionList = res.userList this.searchFormData[1].optionList = res.userList
}) })
},
update() {
const id = this.$route.params.id
this.$apis.customerTransform.groupDetailUpdate({ id }).then(res => {
console.log(res)
if (res) {
this.handleSearch()
}
})
} }
} }
} }
...@@ -196,7 +206,8 @@ export default { ...@@ -196,7 +206,8 @@ export default {
background-color: #ffffff; background-color: #ffffff;
box-shadow: 0px 1px 5px 0px rgba(38, 38, 38, 0.1); box-shadow: 0px 1px 5px 0px rgba(38, 38, 38, 0.1);
.search-btns { .search-btns {
float: right; // float: right;
text-align: right;
} }
} }
.footer-panel { .footer-panel {
......
...@@ -152,7 +152,9 @@ export default { ...@@ -152,7 +152,9 @@ export default {
customerlist: [], customerlist: [],
basicInfo: {}, basicInfo: {},
eventBus: new Vue(), eventBus: new Vue(),
isDisabled: false isDisabled: false,
footerLeft: 0,
footerWidth: 0
} }
}, },
mounted() { mounted() {
......
...@@ -46,7 +46,10 @@ ...@@ -46,7 +46,10 @@
</span> </span>
</div> </div>
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<span v-if="scope.scope.status == -1" style="color: #EB4E4E;">创建失败</span> <span
v-if="scope.scope.status == -1 || scope.scope.status == 2"
style="color: #EB4E4E;"
>创建失败</span>
<span v-else> <span v-else>
<el-button <el-button
type="text" type="text"
...@@ -256,6 +259,12 @@ export default { ...@@ -256,6 +259,12 @@ export default {
if (pathArr[2] == 'addCustomerGroup' || pathArr[2] == 'detaiCustomeGroup') vm.activeIndex = 2 if (pathArr[2] == 'addCustomerGroup' || pathArr[2] == 'detaiCustomeGroup') vm.activeIndex = 2
}) })
}, },
mounted() {
this.wxTips()
},
beforeDestroy() {
this.$message.closeAll()
},
methods: { methods: {
switchMenu(val) { switchMenu(val) {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -313,6 +322,32 @@ export default { ...@@ -313,6 +322,32 @@ export default {
default: default:
console.log(11) console.log(11)
} }
},
jumpWx() {
// this.$history.push('/settings/enterpriseWechat/index')
this.$history.push('/home/enterpriseWechat/index')
},
wxTips() {
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menu.forEach(item => {
if (!item.children) {
return
}
item.children.forEach(itm => {
if (itm.path == '/enterpriseWechat/index') {
this.$apis.customerTransform.getStatus({}).then(res => {
if (res.status != 'SUCCESS') {
const h = this.$createElement
this.$message({
showClose: true,
duration: 0,
message: h('p', null, [h('span', null, '此功能需完成【企业微信授权】后方可使用! '), h('span', { on: { click: this.jumpWx }, style: { marginRight: '150px', cursor: 'pointer', color: '#5850ff' } }, ['企业微信授权 ', h('i', { class: 'el-icon-d-arrow-right' }, '')])])
})
}
})
}
})
})
} }
} }
} }
......
<!-- 礼包详情 -->
<template>
<div class="edit-gift marketing p-t-20 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>
<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="receiveDetails">{{ editForm.receiveWay == '1' ? '指定手机号' : '指定车架号后6位' }}:{{ editForm.receiveDetails }}</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>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleCancel">返回</el-button>
</div>
</div>
</template>
<script>
export default {
name: 'giftDetail',
data() {
return {
size: 'small',
title: '礼包详情',
footerLeft: '0',
footerWidth: '0',
loading: false,
editChildRef: 'editChildRef',
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: []
},
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' }]
},
isEdit: true,
editFormData: [
{
label: '礼包名称',
name: 'name',
type: 'showTxt'
},
{
label: '备注名称',
name: 'remarkName',
type: 'showTxt'
},
{
label: '礼包设置',
name: 'couponList',
addHtml: 'couponListBlock'
},
{
label: '领取条件',
name: 'receiveWay',
addHtml: 'receiveDetails'
},
{
label: '发放员工',
name: 'staffList',
addHtml: 'staffListBlock'
},
{
label: '赠送原因',
name: 'giveReason',
type: 'showTxt'
}
]
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.query
this.loading = true
this.getInfo()
},
methods: {
getInfo() {
this.$apis.giftBag
.getGiftInfoApi({ id: this.routeInfo.id })
.then(res => {
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)
})
},
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: '/giftBag/index'
})
}
}
}
</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;
}
.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;
.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;
}
}
}
// 发放员工
.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;
}
}
</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>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button :size="size" type="default" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<glsx-combi-form ref="showSearch">
<span slot="footer" class="footer-btns">
<GLButton :size="size" class="default-blue-btn" type="default" fn="导出" @click="handleExport">导出</GLButton>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :hasNum="false" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @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.couponList" :key="index">
<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">
<GLButton type="text" fn="编辑" @click="handleEdit('edit', scope.scope)">编辑</GLButton>
<GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant'
export default {
name: 'giftList',
data() {
return {
size: 'small',
url: url,
searchForm: {
name: '',
staffName: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '礼包名称',
name: 'name',
type: 'input',
maxlength: 30,
placeholder: '请输入礼包名称或备注名称',
isClear: true
},
{
label: '发放员工',
name: 'staffName',
type: 'input',
maxlength: 30,
isClear: true
},
{
label: '创建时间',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格
getListApi: this.$apis.giftBag.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '',
prop: '',
columnattrs: {
type: 'expand'
},
addHtml: 'giftInfo'
},
{
label: '序号',
prop: 'idx',
width: '60'
},
{
label: '礼包名称',
prop: 'name',
addHtml: 'name'
},
{
label: '备注名称',
prop: 'remarkName',
width: '200'
},
{
label: '预估成本/元',
prop: 'anticipatedCost',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
}
},
{
label: '发放员工',
prop: 'staffList',
formatter: cellValue => {
return cellValue.staffList.map(item => item.staffName).join(',')
}
},
{
label: '赠送原因',
prop: 'giveReason',
formatter: cellValue => {
return cellValue.giveReason || '-'
}
},
{
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' },
baseData: {
commentStatusList: [
{
confId: '0',
confName: '未发布'
},
{
confId: '1',
confName: '已发布'
}
]
}
}
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
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()
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.giftBag.giftExportApi(params).then(res => {
aToExport(res)
})
},
handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该礼包?', 'giftBag', 'deleteGiftApi', { id: row.id })
},
// 查看
handleDetail(row) {
this.$router.push({
path: '/giftBag/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: '/giftBag/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.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: '',
staffName: '',
createDate: []
}
this.handleSearch()
}
}
}
</script>
<style lang="scss">
.p-b-12 {
margin-bottom: 14px;
}
.gift-detail .gift-item {
margin-right: 80px;
.gift-coupon-name {
display: inline-block;
margin-right: 7px;
}
.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.vue'
export default {
name: 'gitfBag',
data() {
return {
activeName: 'giftList'
}
},
components: {
giftList,
receivedGiftList
},
mounted() { },
methods: {
handleTabClick() { }
}
}
</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>
<glsx-dialog class="muti-pro" title="选择员工" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose" v-loading="loading">
<div class="noproDiv" v-show="!staffList.length && fnCallBack">
<img src="@/assets/noPro.png" />
<p class="noproP">系统暂无已创建的员工</p>
</div>
<div v-show="staffList.length">
<slot name="search"></slot>
<GLTable v-loading="loading" ref="mutiProRef" :tableData="staffList" :pageConf="pageConf" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList"></GLTable>
</div>
</glsx-dialog>
</template>
<script>
import url from '@/assets/empty.png'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectStaffDialog',
data() {
return {
// 表格组件
userInfo: {},
staffList: [],
fnCallBack: false,
url: url,
loading: true,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'userOneId',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '部门',
prop: 'departmentName'
},
{
label: '跟进员工类型',
prop: 'followerTypeName'
}
]
}
}
},
props: {
isMutiSelectVisible: {
type: Boolean,
default: false
},
searchForm: {
type: Object,
default: () => { }
},
selectedStaffList: {
type: Array,
default: () => []
}
},
components: {
glsxDialog
},
mounted() {
this.userInfo = this.$globalState.session
this.getList({}, true)
},
methods: {
getList(page, isResetPage = false) {
var params = {
...this.searchForm,
pageNum: isResetPage ? 1 : this.$refs.mutiProRef.page.pageNum,
pageSize: isResetPage ? 10 : this.$refs.mutiProRef.page.pageSize
}
this.loading = true
this.$apis.giftBag.getFollowerStaffListApi(params).then(res => {
// 重置分页组件
if (this.$refs.mutiProRef && isResetPage) {
this.$refs.mutiProRef.page.pageNum = 1
this.$refs.mutiProRef.page.pageSize = 10
}
this.staffList = res.data
this.loading = false
this.fnCallBack = true
this.$refs.mutiProRef.tableTotal = res.count
this.recoverySelected()
this.$refs.mutiProRef.tableHeightValues = '50vh'
})
},
recoverySelected() {
if (this.selectedStaffList && this.selectedStaffList.length) {
this.selectedStaffList.forEach(row => {
row.userOneId = row.staffUUID
this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row)
})
}
},
handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
this.$emit('handleMutiSelectClose')
}
}
}
</script>
<style>
.muti-pro .m-t-10 {
margin-top: 10px;
}
.muti-pro .noproP {
width: 100%;
height: 20px;
font-family: PingFangSC-Medium;
font-size: 16px;
color: #666666;
line-height: 20px;
font-weight: 500;
text-align: center;
}
</style>
...@@ -637,7 +637,8 @@ export default { ...@@ -637,7 +637,8 @@ export default {
} }
.coupons { .coupons {
// width: 570px; // width: 570px;
width: 66.6%; width: calc(67% - 11px);
// width: 66.6%;
box-sizing: border-box; box-sizing: border-box;
&-content { &-content {
display: inline-flex; display: inline-flex;
...@@ -654,8 +655,9 @@ export default { ...@@ -654,8 +655,9 @@ export default {
} }
.activity { .activity {
display: inline-block; display: inline-block;
// width: 275px; min-width: 275px;
width: calc(33.3% - 20px); width: calc(33% - 9px);
// width: calc(33.3% - 20px);
box-sizing: border-box; box-sizing: border-box;
} }
.name { .name {
......
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
<div class="banner-upload-box"> <div class="banner-upload-box">
<div class=""> <div class="">
<div class="flex"> <div class="flex">
<div v-show="!subItem.bannerImg" class="activity-img home-img-w-h" style="margin-bottom: 11px;"> <div v-show="!subItem.bannerImg" class="activity-img home-img-w-h" style="margin-bottom: 11px">
<div class="add">+</div> <div class="add">+</div>
<span class="number">上传</span> <span class="number">上传</span>
<input type="file" style="opacity: 0;" ref="file" class="activity-img home-img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, subIndex)" /> <input type="file" style="opacity: 0" ref="file" class="activity-img home-img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, subIndex)" />
</div> </div>
<div v-show="!subItem.bannerImg" style="margin-left: 40px;"> <div v-show="!subItem.bannerImg" style="margin-left: 40px">
<el-button type="text" class="el-icon-delete" @click="handleBannerDelete(subIndex)"></el-button> <el-button type="text" class="el-icon-delete" @click="handleBannerDelete(subIndex)"></el-button>
</div> </div>
</div> </div>
...@@ -46,15 +46,16 @@ ...@@ -46,15 +46,16 @@
<span>banner链接</span> <span>banner链接</span>
<div class="banner-link"> <div class="banner-link">
<el-radio-group v-model="subItem.bannerType"> <el-radio-group v-model="subItem.bannerType">
<el-radio v-for="(m, n) in bannerRadioList" :key="n" :label="m.confId">{{m.confName}}</el-radio> <el-radio v-for="(m, n) in bannerRadioList" :key="n" :label="m.confId">{{ m.confName }}</el-radio>
</el-radio-group> </el-radio-group>
<div v-show="subItem.bannerType != '0'" class="link-block"> <div v-show="subItem.bannerType != '0'" class="link-block">
<div v-show="(subItem.bannerType == '1' && !subItem.goodsId) || (subItem.bannerType == '2' && !subItem.imgLinkUrl) || (subItem.bannerType == '3' && !subItem.videoLinkUrl)"> <div v-show="(subItem.bannerType == '1' && !subItem.goodsId) || (subItem.bannerType == '2' && !subItem.imgLinkUrl) || (subItem.bannerType == '3' && !subItem.videoLinkUrl)">
<el-button class="banner-btn" type="primary" :size="size" @click="handleBnnerLinkClick(scope.scope, subIndex)">选择 <el-button class="banner-btn" type="primary" :size="size" @click="handleBnnerLinkClick(scope.scope, subIndex)">
选择
<input v-if="subItem.bannerType == '2'" type="file" ref="file" class="upload-btn" accept="image/png, image/jpeg, image/jpg" @change="e => handleUploadChange(e, item)" /> <input v-if="subItem.bannerType == '2'" type="file" ref="file" class="upload-btn" accept="image/png, image/jpeg, image/jpg" @change="e => handleUploadChange(e, item)" />
<input v-if="subItem.bannerType == '3'" type="file" ref="file" class="upload-btn" accept="video/mp4" @change="e => handleUploadVideoChange(e, item)" /> <input v-if="subItem.bannerType == '3'" type="file" ref="file" class="upload-btn" accept="video/mp4" @change="e => handleUploadVideoChange(e, item)" />
</el-button> </el-button>
<p class="banner-tips-txt">点击banner后跳转{{subItem.bannerType == '1' ? '商品' : (subItem.bannerType == '2' ? '图文介绍' : '视频介绍')}}</p> <p class="banner-tips-txt">点击banner后跳转{{ subItem.bannerType == '1' ? '商品' : subItem.bannerType == '2' ? '图文介绍' : '视频介绍' }}</p>
</div> </div>
<!-- 选择商品 --> <!-- 选择商品 -->
<div v-show="subItem.bannerType == '1' && subItem.goodsId" class="flex-grow"> <div v-show="subItem.bannerType == '1' && subItem.goodsId" class="flex-grow">
...@@ -103,7 +104,7 @@ ...@@ -103,7 +104,7 @@
</div> </div>
<template slot="customerServerSuffix" slot-scope="scope"> <template slot="customerServerSuffix" slot-scope="scope">
<el-button v-show="!scope.scope.optionList.length" type="text"></el-button> <el-button v-show="!scope.scope.optionList.length" type="text"></el-button>
<p style="color: #5850ff;" @click="handleNoServer">请在首页-跟进专员模块里添加类型为“在线客服”的跟进专员</p> <p style="color: #5850ff" @click="handleNoServer">请在首页-跟进专员模块里添加类型为“在线客服”的跟进专员</p>
</template> </template>
<!-- <div slot="serviceTable" :style="{ 'margin-left': labelWidth, width: `calc(100% - ${labelWidth} )` }"> <!-- <div slot="serviceTable" :style="{ 'margin-left': labelWidth, width: `calc(100% - ${labelWidth} )` }">
<GLTable v-show="editForm.customerServerUserId" :hasPage="false" :tableParams="tableParams" :tableData="customerServerList"></GLTable> <GLTable v-show="editForm.customerServerUserId" :hasPage="false" :tableParams="tableParams" :tableData="customerServerList"></GLTable>
...@@ -111,7 +112,7 @@ ...@@ -111,7 +112,7 @@
</glsx-combi-form> </glsx-combi-form>
</div> </div>
</div> </div>
<div class="wechat-container m-r-20" style="margin-top: 59px;"> <div class="wechat-container m-r-20" style="margin-top: 59px">
<div class="wechat-box"> <div class="wechat-box">
<img class="w-100-per" src="@/assets/phone.png" /> <img class="w-100-per" src="@/assets/phone.png" />
<img class="wechant-back" src="@/assets/home-set.png" /> <img class="wechant-back" src="@/assets/home-set.png" />
...@@ -124,9 +125,9 @@ ...@@ -124,9 +125,9 @@
</el-carousel> </el-carousel>
</div> </div>
<div class="wechant-notice"> <div class="wechant-notice">
<img class="img-14" src="@/assets/icon_notice.png"> <img class="img-14" src="@/assets/icon_notice.png" />
<span> <span>
<marquee width="200px" height="14px" scrolldelay="160">{{editForm.noticeContent}}</marquee> <marquee width="200px" height="14px" scrolldelay="160">{{ editForm.noticeContent }}</marquee>
</span> </span>
</div> </div>
</div> </div>
...@@ -139,21 +140,16 @@ ...@@ -139,21 +140,16 @@
<!-- 在线客服 --> <!-- 在线客服 -->
<glsx-dialog class="server-dialog" title="在线客服" width="712px" :noBtnOk="true" :isVisible.sync="isConsultantVisible" @confirmDialog="handleConsultantConfirm" @closeDialog="handleConsultantClose"> <glsx-dialog class="server-dialog" title="在线客服" width="712px" :noBtnOk="true" :isVisible.sync="isConsultantVisible" @confirmDialog="handleConsultantConfirm" @closeDialog="handleConsultantClose">
<div class="server-container"> <div class="server-container">
<img src="@/assets/no-server.png"/> <img src="@/assets/no-server.png" />
<p class="server-txt">系统暂无已创建的在线客服</p> <p class="server-txt">系统暂无已创建的在线客服</p>
</div> </div>
<template slot="btn-middle"> <template slot="btn-middle">
<GLButton <GLButton type="primary" :size="size" fn="创建客服" @click="handleConsultantConfirm">创建客服</GLButton>
type="primary"
:size="size"
fn="创建客服"
@click="handleConsultantConfirm"
>创建客服</GLButton>
</template> </template>
</glsx-dialog> </glsx-dialog>
<el-dialog v-if="isImgVisible" :visible.sync="isImgVisible" class="dialog-look"> <el-dialog v-if="isImgVisible" :visible.sync="isImgVisible" class="dialog-look">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls> <video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4"> <source :src="dialogObj.url" type="video/mp4" />
</video> </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="" />
</el-dialog> </el-dialog>
...@@ -308,7 +304,7 @@ export default { ...@@ -308,7 +304,7 @@ export default {
this.editForm.customerServerUserTitle = tempObj.staffTitle this.editForm.customerServerUserTitle = tempObj.staffTitle
this.customerServerList.push({ this.customerServerList.push({
customerServerName: tempObj.staffName, customerServerName: tempObj.staffName,
customerServerUserTitle: tempObj.staffTitle, customerServerUserTitle: tempObj.staffTitle
}) })
} }
} }
...@@ -366,10 +362,10 @@ export default { ...@@ -366,10 +362,10 @@ export default {
imgLinkUrl: '', imgLinkUrl: '',
videoLinkUrl: '' videoLinkUrl: ''
} }
if(item.bannerType == '2') { if (item.bannerType == '2') {
params.imgLinkUrl = item.linkUrl params.imgLinkUrl = item.linkUrl
} }
if(item.bannerType == '3') { if (item.bannerType == '3') {
params.videoLinkUrl = item.linkUrl params.videoLinkUrl = item.linkUrl
} }
if (item.goods) { if (item.goods) {
...@@ -397,7 +393,7 @@ export default { ...@@ -397,7 +393,7 @@ export default {
this.$messageBox.confirm('是否删除该banner?', '删除', { this.$messageBox.confirm('是否删除该banner?', '删除', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'error', // type: 'error',
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
this.editForm[attrName].splice(subIndex, 1) this.editForm[attrName].splice(subIndex, 1)
...@@ -457,14 +453,14 @@ export default { ...@@ -457,14 +453,14 @@ export default {
handleBnnerLinkClick(targetItem, idx) { handleBnnerLinkClick(targetItem, idx) {
this.curBanner.idx = idx this.curBanner.idx = idx
this.curBanner.targetItem = targetItem this.curBanner.targetItem = targetItem
switch(this.editForm.bannerList[idx].bannerType) { switch (this.editForm.bannerList[idx].bannerType) {
case '1': case '1':
this.handleSinglePro(targetItem, idx) this.handleSinglePro(targetItem, idx)
break; break
case '2': case '2':
break; break
case '3': case '3':
break; break
} }
}, },
// banner - 图片上传 // banner - 图片上传
...@@ -569,7 +565,7 @@ export default { ...@@ -569,7 +565,7 @@ export default {
linkUrl: '', linkUrl: '',
goods: {} goods: {}
}) })
if(item.bannerType == '1' && item.goodsId) { if (item.bannerType == '1' && item.goodsId) {
params.bannerList[idx].goodsId = item.goodsId params.bannerList[idx].goodsId = item.goodsId
params.bannerList[idx].goods = { params.bannerList[idx].goods = {
id: item.goods.id, id: item.goods.id,
...@@ -577,13 +573,13 @@ export default { ...@@ -577,13 +573,13 @@ export default {
goodsImage: item.goods.goodsImage goodsImage: item.goods.goodsImage
} }
} }
if(item.bannerType == '2' && item.imgLinkUrl) { if (item.bannerType == '2' && item.imgLinkUrl) {
params.bannerList[idx].linkUrl = item.imgLinkUrl params.bannerList[idx].linkUrl = item.imgLinkUrl
} }
if(item.bannerType == '3' && item.videoLinkUrl) { if (item.bannerType == '3' && item.videoLinkUrl) {
params.bannerList[idx].linkUrl = item.videoLinkUrl params.bannerList[idx].linkUrl = item.videoLinkUrl
} }
if((item.bannerType == '1' && !item.goodsId) || (item.bannerType == '2' && !item.imgLinkUrl) || (item.bannerType == '3' && !item.videoLinkUrl)) { if ((item.bannerType == '1' && !item.goodsId) || (item.bannerType == '2' && !item.imgLinkUrl) || (item.bannerType == '3' && !item.videoLinkUrl)) {
params.bannerList[idx].bannerType = 0 params.bannerList[idx].bannerType = 0
} }
}) })
...@@ -610,7 +606,7 @@ export default { ...@@ -610,7 +606,7 @@ export default {
position: absolute; position: absolute;
top: 56px; top: 56px;
left: 19px; left: 19px;
border: 1px solid #D8D8D8; border: 1px solid #d8d8d8;
} }
.home-set .wechat-container .wechat-box .wechant-banner-img { .home-set .wechat-container .wechat-box .wechant-banner-img {
position: absolute; position: absolute;
...@@ -681,8 +677,8 @@ export default { ...@@ -681,8 +677,8 @@ export default {
width: 100%; width: 100%;
height: 72px; height: 72px;
text-align: center; text-align: center;
background-color: #F7F7F7; background-color: #f7f7f7;
border: 1px solid #DCDFE6; border: 1px solid #dcdfe6;
} }
.home-set .link-block .banner-btn { .home-set .link-block .banner-btn {
position: relative; position: relative;
......
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
<el-form-item size="small" class="fr-mr0"> <el-form-item size="small" class="fr-mr0">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
<el-button :size="size" @click="handleReset">重置</el-button> <el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item> </el-form-item>
</el-row> </el-row>
...@@ -121,8 +122,8 @@ ...@@ -121,8 +122,8 @@
<script> <script>
import glsxDialog from '@/components/glsx-dialog' import glsxDialog from '@/components/glsx-dialog'
import { getCenterListApi, getMoreMerchant, getCardContent, updateCardContent } from '@/api/modules/center' import { getCenterListApi, getMoreMerchant, getCardContent, updateCardContent,memberExportApi } from '@/api/modules/center'
import { statusList, memberTypeList } from '@/common/constant' import { statusList, memberTypeList,exportFn } from '@/common/constant'
export default { export default {
components: { components: {
glsxDialog glsxDialog
...@@ -353,19 +354,40 @@ mounted () { ...@@ -353,19 +354,40 @@ mounted () {
}) })
}) })
}, },
beforeSearchFn() { getParams() {
return new Promise((resolve, reject) => { var params = JSON.parse(JSON.stringify(this.searchForm))
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm)) if (params.daterange) {
if (this.searchFormTable.daterange) { params.startTime = this.searchForm.daterange[0] + ' 00:00:00'
this.searchFormTable.startTime = this.searchForm.daterange[0] + ' 00:00:00' params.endTime = this.searchForm.daterange[1] + ' 23:59:59'
this.searchFormTable.endTime = this.searchForm.daterange[1] + ' 23:59:59'
} else { } else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime if (params.beginTime) delete params.beginTime && delete params.endTime
} }
delete this.searchFormTable.daterange delete params.daterange
return params
},
beforeSearchFn() {
// return new Promise((resolve, reject) => {
// this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
// if (this.searchFormTable.daterange) {
// this.searchFormTable.startTime = this.searchForm.daterange[0] + ' 00:00:00'
// this.searchFormTable.endTime = this.searchForm.daterange[1] + ' 23:59:59'
// } else {
// if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
// }
// delete this.searchFormTable.daterange
// resolve()
// })
return new Promise((resolve, reject) => {
this.searchFormTable = this.getParams()
resolve() resolve()
}) })
}, },
handleExport(row) {
var params = this.getParams()
memberExportApi(params).then(res => {
exportFn(res)
})
},
handleReset() { handleReset() {
this.searchForm = {} this.searchForm = {}
......
...@@ -236,9 +236,7 @@ export default { ...@@ -236,9 +236,7 @@ export default {
}, },
setTableFinishFun() { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
if (!this.$refs.memberOrderRef.data.length) { this.$refs.memberOrderRef.data.length ? (this.$refs.memberOrderRef.tableHeightValues = '') : this.$refs.memberOrderRef.setTableHeightFun()
this.$refs.memberOrderRef.setTableHeightFun()
}
}, },
handleReset() { handleReset() {
this.isReload = false this.isReload = false
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<!-- //提示面板组件 --> <!-- //提示面板组件 -->
<tip-panel panelWidth="616px" panelMinHeight="60px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel> <tip-panel panelWidth="616px" panelMinHeight="60px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel>
<div class="live-room container"> <div class="live-room container">
<el-form :inline="true" style="width:100%" :model="searchForm" label-width="70px" label-position="right"> <el-form :inline="true" style="width: 100%" :model="searchForm" label-width="70px" label-position="right">
<el-row> <el-row>
<!-- <el-form-item size="small"> --> <!-- <el-form-item size="small"> -->
<!-- <el-button :size="size" type="primary" icon="el-icon-plus" @click="handleCreate">创建服务</el-button>display="disabled" --> <!-- <el-button :size="size" type="primary" icon="el-icon-plus" @click="handleCreate">创建服务</el-button>display="disabled" -->
<GLButton type="primary" @click="handleCreate" style="margin-right:30px" size="small" icon="el-icon-plus" fn="创建服务" mode="el-button">创建服务</GLButton> <GLButton type="primary" @click="handleCreate" style="margin-right: 30px" size="small" icon="el-icon-plus" fn="创建服务" mode="el-button">创建服务</GLButton>
<!-- </el-form-item> --> <!-- </el-form-item> -->
<el-form-item size="small" label="服务名称"> <el-form-item size="small" label="服务名称">
<el-input :size="size" v-model="searchForm.couponName" placeholder="请输入服务名称" clearable></el-input> <el-input :size="size" v-model="searchForm.couponName" placeholder="请输入服务名称" clearable></el-input>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> --> <el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<GLButton type="text" @click="handleLossOption(scope.scope)" fn="失效">失效</GLButton> <GLButton type="text" @click="handleLossOption(scope.scope)" fn="失效">失效</GLButton>
<GLButton type="text" @click="handleLook(scope.scope)" fn="查看服务" >查看</GLButton> <GLButton type="text" @click="handleLook(scope.scope)" fn="查看服务">查看</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton> <GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template> </template>
<template v-else-if="scope.scope.status == 3"> <template v-else-if="scope.scope.status == 3">
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
</template> </template>
<script> <script>
import { getServiceListApi, effectiveService, deleteService,getLoginCount } from '@/api/modules/service' import { getServiceListApi, effectiveService, deleteService, getLoginCount } from '@/api/modules/service'
import url from "@/assets/empty.png" import url from '@/assets/empty.png'
import { serviceStatusList } from '@/common/constant' import { serviceStatusList } from '@/common/constant'
import tipPanel from '@/components/tipPanel/index.vue' import tipPanel from '@/components/tipPanel/index.vue'
export default { export default {
...@@ -67,8 +67,8 @@ export default { ...@@ -67,8 +67,8 @@ export default {
}, },
data() { data() {
return { return {
url:url, url: url,
isReload:true, isReload: true,
isFirstShow: false, isFirstShow: false,
panelContent: '会员服务:是由门店根据自店服务项目创建的线上服务券,如“一年十二次洗车券”、“陶瓷镀膜”等,客户购买后可到店出示服务券享受服务,门店扫码进行次数核销。', panelContent: '会员服务:是由门店根据自店服务项目创建的线上服务券,如“一年十二次洗车券”、“陶瓷镀膜”等,客户购买后可到店出示服务券享受服务,门店扫码进行次数核销。',
size: 'small', size: 'small',
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
searchForm: { searchForm: {
couponName: '', couponName: '',
merchantId: 44184606, merchantId: 44184606,
discountType:7//6:商品折扣券,7:会员服务 discountType: 7 //6:商品折扣券,7:会员服务
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数 // 表格参数
...@@ -99,6 +99,13 @@ export default { ...@@ -99,6 +99,13 @@ export default {
line: 1 line: 1
}, },
{ {
label: '预估成本/元',
prop: 'anticipatedCost ',
formatter: cellValue => {
return cellValue.anticipatedCost / 100
}
},
{
label: '有效期', label: '有效期',
prop: 'effectiveType', prop: 'effectiveType',
addHtml: 'effectiveType' addHtml: 'effectiveType'
...@@ -125,7 +132,7 @@ export default { ...@@ -125,7 +132,7 @@ export default {
{ {
label: '创建时间', label: '创建时间',
prop: 'createdDate', prop: 'createdDate',
width:95 width: 95
} }
] ]
}, },
...@@ -139,13 +146,11 @@ export default { ...@@ -139,13 +146,11 @@ export default {
if (window.__POWERED_BY_QIANKUN__) { if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中 //运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId this.merchantId = this.$globalState.session.merchantId
this.searchForm.merchantId=this.merchantId this.searchForm.merchantId = this.merchantId
} }
this.getLoginCountFun() this.getLoginCountFun()
}, },
mounted () { mounted() {},
},
methods: { methods: {
getLoginCountFun() { getLoginCountFun() {
//loginType:4是查会员服务浏览次数 //loginType:4是查会员服务浏览次数
...@@ -172,20 +177,19 @@ export default { ...@@ -172,20 +177,19 @@ export default {
case 0: case 0:
return '无限制' return '无限制'
case 1: case 1:
return row.useAmount return '有效期内可使用' + row.useAmount + '次'
case 2: case 2:
return '每' + row.useLimitDays + '天可以使用' + row.useAmount + '次' return '每' + row.useLimitDays + '天可以使用' + row.useAmount + '次'
} }
}, },
handleReset() { handleReset() {
this.isReload=false this.isReload = false
this.searchForm = { couponName: '', merchantId: this.merchantId, discountType:7 } this.searchForm = { couponName: '', merchantId: this.merchantId, discountType: 7 }
// this.handleSearch() // this.handleSearch()
this.$nextTick(()=>{ this.$nextTick(() => {
this.isReload=true this.isReload = true
}) })
}, },
handleSearch() { handleSearch() {
this.$refs.memberServiceRef.refreshTable() this.$refs.memberServiceRef.refreshTable()
...@@ -202,8 +206,8 @@ export default { ...@@ -202,8 +206,8 @@ export default {
handleCreate() { handleCreate() {
this.$router.push({ this.$router.push({
path: '/memberCenter/serviceAddUpdateLook', path: '/memberCenter/serviceAddUpdateLook',
query:{ query: {
$title:encodeURI('创建服务') $title: encodeURI('创建服务')
} }
}) })
}, },
...@@ -246,7 +250,7 @@ export default { ...@@ -246,7 +250,7 @@ export default {
query: { query: {
couponId: row.id, couponId: row.id,
title: '编辑', title: '编辑',
$title:encodeURI('编辑服务') $title: encodeURI('编辑服务')
} }
}) })
}, },
...@@ -256,7 +260,7 @@ export default { ...@@ -256,7 +260,7 @@ export default {
query: { query: {
couponId: row.id, couponId: row.id,
title: '查看', title: '查看',
$title:encodeURI('查看服务') $title: encodeURI('查看服务')
} }
}) })
}, },
...@@ -285,8 +289,7 @@ export default { ...@@ -285,8 +289,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.el-input--small .el-input__inner {
/deep/.el-input--small .el-input__inner{
width: 215px; width: 215px;
} }
</style> </style>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="allChoseWrap" v-if="this.choseItemList.length > 0"> <div class="allChoseWrap" v-if="this.choseItemList.length > 0">
<!-- choseItemList --> <!-- choseItemList -->
<div class="choseItem" v-for="(item, index) in choseItemList" :key="index"> <div class="choseItem" v-for="(item, index) in choseItemList" :key="index">
<span>{{ item.couponName }}</span> <span>{{ item.couponName }}×{{ item.serviceQuantity }}</span>
<!-- <img src="@/assets/closeIcon.png" @click="closeChoseItemFun(item, index)" alt="" /> --> <!-- <img src="@/assets/closeIcon.png" @click="closeChoseItemFun(item, index)" alt="" /> -->
<div class="close-x" @click="closeChoseItemFun(item, index)">×</div> <div class="close-x" @click="closeChoseItemFun(item, index)">×</div>
</div> </div>
...@@ -34,6 +34,32 @@ ...@@ -34,6 +34,32 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item size="small" label="计价器" prop="switchStatus">
<el-switch v-model="ruleForm.switchStatus" active-color="#5850ff" active-text="开" inactive-text="关"></el-switch>
<span class="calcValueMsg">开启后,小程序端套餐详情将展示该信息</span>
</el-form-item>
<template v-if="ruleForm.switchStatus">
<div class="shopValuePanel">
<div class="setmealName">套餐服务</div>
<div class="rowMsg" v-for="(item, index) in choseItemList" :key="index">
<span>
{{ item.couponName }}
<span style="color: #4a4a4a">×{{ item.serviceQuantity }}</span>
</span>
<span>
价值约:
<span style="color: #ff5151">{{ item.shopPrice * item.serviceQuantity }}元</span>
</span>
</div>
</div>
<div class="allPrice" v-if="choseItemList.length > 0">
套餐内服务实际价值总计约:
<span class="price">{{ totalShopPrice }}元</span>
</div>
</template>
<el-form-item size="small" label="说明" prop="notes" style="width: 670px"> <el-form-item size="small" label="说明" prop="notes" style="width: 670px">
<el-input size="small" :rows="6" type="textarea" v-model="ruleForm.notes" placeholder="请输入" maxlength="200" show-word-limit></el-input> <el-input size="small" :rows="6" type="textarea" v-model="ruleForm.notes" placeholder="请输入" maxlength="200" show-word-limit></el-input>
</el-form-item> </el-form-item>
...@@ -46,7 +72,7 @@ ...@@ -46,7 +72,7 @@
width: footerWidth + 'px' width: footerWidth + 'px'
}" }"
> >
<el-button type="primary" @click="submitForm('ruleForm')" size="medium">创建</el-button> <el-button type="primary" @click="submitForm('ruleForm')" size="medium" :loading="sloading">创建</el-button>
<el-button type="primary" @click="goBack" size="medium">取消</el-button> <el-button type="primary" @click="goBack" size="medium">取消</el-button>
</div> </div>
<!-- :modalAppendToBody="false" --> <!-- :modalAppendToBody="false" -->
...@@ -102,7 +128,10 @@ ...@@ -102,7 +128,10 @@
</div> </div>
</glsx-dialog> </glsx-dialog>
<glsx-dialog title="" top="30vh" :hasScroll="false" class="tipDialog" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isTipDialogVisible" :showClose="false" @closeDialog="handleTipClose" @confirmDialog="handleTipConfirm"> <glsx-dialog title="" top="30vh" :hasScroll="false" class="tipDialog" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isTipDialogVisible" :showClose="false" @closeDialog="handleTipClose" @confirmDialog="handleTipConfirm">
<div class="content-body">当前有内容信息未保存,是否继续返回</div> <div class="content-body">
<img src="@/assets/icon-warning.png" alt="" />
<div>当前有内容信息未保存,是否继续返回?</div>
</div>
</glsx-dialog> </glsx-dialog>
</div> </div>
</template> </template>
...@@ -117,9 +146,11 @@ export default { ...@@ -117,9 +146,11 @@ export default {
}, },
data() { data() {
return { return {
sloading:false,
ruleForm: { ruleForm: {
packageName: '', packageName: '',
packagePrice: '', packagePrice: '',
switchStatus: true,
notes: '' notes: ''
}, },
copyRuleForm: {}, //用于检查页面信息是否改动 copyRuleForm: {}, //用于检查页面信息是否改动
...@@ -143,6 +174,18 @@ export default { ...@@ -143,6 +174,18 @@ export default {
id: this.$route.query.id || 0 id: this.$route.query.id || 0
} }
}, },
computed: {
totalShopPrice() {
var sum = 0
if (this.choseItemList.length > 0) {
this.choseItemList.forEach(item => {
sum = ((sum * 100 + item.shopPrice * item.serviceQuantity * 100) / 100).toFixed(2)
})
return sum
}
return 0
}
},
created() { created() {
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据 this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
if (window.__POWERED_BY_QIANKUN__) { if (window.__POWERED_BY_QIANKUN__) {
...@@ -193,6 +236,7 @@ export default { ...@@ -193,6 +236,7 @@ export default {
getServiceInfo({ id: this.id }).then(res => { getServiceInfo({ id: this.id }).then(res => {
if (res.code == '0') { if (res.code == '0') {
this.ruleForm = res.data this.ruleForm = res.data
this.ruleForm.switchStatus = res.data.switchStatus == 1 ? true : false
this.choseItemList = res.data.list || [] this.choseItemList = res.data.list || []
this.totalPrice = res.data.referencePrice this.totalPrice = res.data.referencePrice
...@@ -200,6 +244,7 @@ export default { ...@@ -200,6 +244,7 @@ export default {
for (let i = 0; i < this.allItemList.length; i++) { for (let i = 0; i < this.allItemList.length; i++) {
if (item.serviceId == this.allItemList[i].id) { if (item.serviceId == this.allItemList[i].id) {
item.vipPrice = this.allItemList[i].vipPrice item.vipPrice = this.allItemList[i].vipPrice
item.shopPrice = this.allItemList[i].shopPrice
} }
} }
}) })
...@@ -293,12 +338,15 @@ export default { ...@@ -293,12 +338,15 @@ export default {
param.packageName = this.ruleForm.packageName param.packageName = this.ruleForm.packageName
param.packagePrice = this.ruleForm.packagePrice param.packagePrice = this.ruleForm.packagePrice
param.notes = this.ruleForm.notes param.notes = this.ruleForm.notes
param.switchStatus = this.ruleForm.switchStatus ? 1 : 0
let lists = this.choseItemList let lists = this.choseItemList
for (var k in lists) { for (var k in lists) {
param[`lists[${k}].serviceQuantity`] = lists[k].serviceQuantity param[`lists[${k}].serviceQuantity`] = lists[k].serviceQuantity
param[`lists[${k}].serviceId`] = lists[k].serviceId param[`lists[${k}].serviceId`] = lists[k].serviceId
} }
this.sloading=true
updateSetMeal(param).then(res => { updateSetMeal(param).then(res => {
this.sloading=false
this.$message({ this.$message({
message: res.code == '0' ? '修改成功' : res.message, message: res.code == '0' ? '修改成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
...@@ -306,6 +354,10 @@ export default { ...@@ -306,6 +354,10 @@ export default {
if (res.code == '0') { if (res.code == '0') {
this.$router.push("/memberCenter/setmeal") this.$router.push("/memberCenter/setmeal")
} }
}).catch(err=>{
this.sloading=false
}).finally(()=>{
this.sloading=false
}) })
} else { } else {
//调创建的接口 //调创建的接口
...@@ -316,12 +368,15 @@ export default { ...@@ -316,12 +368,15 @@ export default {
params.packageName = this.ruleForm.packageName params.packageName = this.ruleForm.packageName
params.packagePrice = this.ruleForm.packagePrice params.packagePrice = this.ruleForm.packagePrice
params.notes = this.ruleForm.notes params.notes = this.ruleForm.notes
params.switchStatus = this.ruleForm.switchStatus ? 1 : 0
let list = this.choseItemList let list = this.choseItemList
for (var i in list) { for (var i in list) {
params[`list[${i}].serviceQuantity`] = list[i].serviceQuantity params[`list[${i}].serviceQuantity`] = list[i].serviceQuantity
params[`list[${i}].serviceId`] = list[i].serviceId params[`list[${i}].serviceId`] = list[i].serviceId
} }
this.sloading=true
createSetMeal(params).then(res => { createSetMeal(params).then(res => {
this.sloading=false
this.$message({ this.$message({
message: res.code == '0' ? '创建成功' : res.message, message: res.code == '0' ? '创建成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
...@@ -329,6 +384,10 @@ export default { ...@@ -329,6 +384,10 @@ export default {
if (res.code == '0') { if (res.code == '0') {
this.$router.push("/memberCenter/setmeal") this.$router.push("/memberCenter/setmeal")
} }
}).catch(err=>{
this.sloading=false
}).finally(()=>{
this.sloading=false
}) })
} }
}) })
...@@ -449,7 +508,7 @@ export default { ...@@ -449,7 +508,7 @@ export default {
} }
} }
.container { .container {
margin: 0 0px 20px; margin: 0 0px 100px;
position: relative; position: relative;
min-height: calc(100vh - 300px); min-height: calc(100vh - 300px);
.allChoseWrap { .allChoseWrap {
...@@ -524,6 +583,54 @@ export default { ...@@ -524,6 +583,54 @@ export default {
color: #ff5151; color: #ff5151;
} }
} }
.calcValueMsg {
margin-left: -8px;
font-size: 14px;
font-weight: 400;
color: #999999;
}
.shopValuePanel {
margin-left: 120px;
margin-bottom: 15px;
width: 550px;
min-height: 140px;
border: 1px solid #e8e8ea;
border-radius: 2px;
padding-bottom: 10px;
.setmealName {
padding-left: 10px;
height: 28px;
line-height: 28px;
background: #fafafa;
border-radius: 2px 2px 0px 0px;
border-bottom: 1px solid #e8e8ea;
font-size: 14px;
font-weight: 400;
color: #666666;
}
.rowMsg {
font-size: 14px;
font-weight: 400;
color: #666666;
margin-top: 10px;
> span:first-child {
display: inline-block;
min-width: 165px;
text-align: right;
margin-right: 10px;
}
}
}
.allPrice {
margin: 0 0 20px 120px;
font-size: 14px;
font-weight: 400;
color: #666666;
.price {
color: #ff5151;
}
}
} }
.footer-panel { .footer-panel {
display: flex; display: flex;
...@@ -701,19 +808,26 @@ export default { ...@@ -701,19 +808,26 @@ export default {
border-bottom: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6;
padding: 20px 25px; padding: 20px 25px;
.content-body { .content-body {
height: 136px;
line-height: 121px;
font-size: 18px;
text-align: center; text-align: center;
height: 98px;
line-height: 26px;
div {
font-size: 16px;
color: #333333;
font-weight: 400;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
} }
} }
}
/deep/ .el-dialog__footer { /deep/ .el-dialog__footer {
border: 0; border: 0;
text-align: center; text-align: center;
padding-top: 15px; padding-top: 15px;
padding-bottom: 15px; padding-bottom: 15px;
.el-button--small{
padding:8px 26px;
}
} }
} }
} }
......
...@@ -36,6 +36,7 @@ export default { ...@@ -36,6 +36,7 @@ export default {
size: 'small', size: 'small',
url: url, url: url,
searchForm: { searchForm: {
orderCode: '',
commentStatus: '', commentStatus: '',
createDate: [] createDate: []
}, },
...@@ -57,6 +58,13 @@ export default { ...@@ -57,6 +58,13 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionsName: 'commentStatusList' optionsName: 'commentStatusList'
},
{
label: '订单编号',
name: 'orderCode',
type: 'input',
maxlength: 17,
isClear: true
} }
], ],
// 表格 // 表格
...@@ -66,9 +74,14 @@ export default { ...@@ -66,9 +74,14 @@ export default {
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '订单编号',
prop: 'orderCode',
width: '200'
},
{
label: '评价日期', label: '评价日期',
prop: 'createdDate', prop: 'createdDate',
// width: '180', width: '180',
formatter: cellValue => { formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
} }
...@@ -150,7 +163,6 @@ export default { ...@@ -150,7 +163,6 @@ export default {
} }
}) })
}, },
// 查看 // 查看
handleDetail(row) { handleDetail(row) {
this.$router.push({ this.$router.push({
...@@ -196,7 +208,6 @@ export default { ...@@ -196,7 +208,6 @@ export default {
}) })
} }
}, },
setTableFinishFun() { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.commentRef.data.length ? (this.$refs.commentRef.tableHeightValues = '') : this.$refs.commentRef.setTableHeightFun() this.$refs.commentRef.data.length ? (this.$refs.commentRef.tableHeightValues = '') : this.$refs.commentRef.setTableHeightFun()
...@@ -208,6 +219,7 @@ export default { ...@@ -208,6 +219,7 @@ export default {
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
orderCode: '',
commentStatus: '', commentStatus: '',
createDate: [] createDate: []
} }
......
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
<span class="red-txt">&nbsp;{{ statisticsInfo.orderCount || 0 }}&nbsp;</span> <span class="red-txt">&nbsp;{{ statisticsInfo.orderCount || 0 }}&nbsp;</span>
项 累计订单总额: 项 累计订单总额:
<span class="red-txt">{{ statisticsInfo.payPriceTotal || 0 }}&nbsp;</span> <span class="red-txt">{{ statisticsInfo.payPriceTotal || 0 }}&nbsp;</span>
元 累计退款总额:
<span class="red-txt">{{ statisticsInfo.refundTotal || 0 }}&nbsp;</span>
元 元
</span> </span>
</div> </div>
<div> <div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData1"> <glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData1"></glsx-combi-form>
</glsx-combi-form> <glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData2"></glsx-combi-form>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData2">
</glsx-combi-form>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData3"> <glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData3">
<span slot="footer" class="footer-btns"> <span slot="footer" class="footer-btns">
<el-button :size="size" type="default" @click="handleReset">重置</el-button> <el-button :size="size" type="default" @click="handleReset">重置</el-button>
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<!-- <el-button type="text" @click="handleDetail(scope.scope)">查看订单</el-button> --> <!-- <el-button type="text" @click="handleDetail(scope.scope)">查看订单</el-button> -->
<GLButton type="text" fn="查看订单" @click="handleDetail(scope.scope)">查看订单</GLButton> <GLButton type="text" fn="查看订单" @click="handleDetail(scope.scope)">查看订单</GLButton>
<el-button v-if="scope.scope.deliveryType == 1 && scope.scope.orderStatus == 14" type="text" @click="handleWriteOff(scope.scope)">订单核销</el-button> <el-button v-if="scope.scope.deliveryType == 1 && scope.scope.orderStatus == 21" type="text" @click="handleWriteOff(scope.scope)">订单核销</el-button>
<el-button v-if="scope.scope.deliveryType == 2 && scope.scope.orderStatus == 13" type="text" @click="handleExpressInfo(scope.scope)">输入快递信息</el-button> <el-button v-if="scope.scope.deliveryType == 2 && scope.scope.orderStatus == 6" type="text" @click="handleExpressInfo(scope.scope)">输入快递信息</el-button>
<el-button v-if="scope.scope.orderStatus == 6" type="text" @click="handleExamine(scope.scope)">退款审核</el-button> <el-button v-if="scope.scope.afterSaleStatus == 1" type="text" @click="handleExamine(scope.scope)">退款审核</el-button>
<el-button v-if="scope.scope.orderStatus == 9" type="text" @click="handleReceiving(scope.scope)">确认收货</el-button> <el-button v-if="scope.scope.afterSaleStatus == 4" type="text" @click="handleReceiving(scope.scope)">确认收货</el-button>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 - 全部订单/售后订单 - end --> <!-- 表格区域 - 全部订单/售后订单 - end -->
...@@ -111,8 +111,8 @@ ...@@ -111,8 +111,8 @@
<script> <script>
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from "@/assets/empty.png" import url from '@/assets/empty.png'
import { orderManageStatusList, orderSourceList, deliveryTypeList, exportFn } from '@/common/constant' import { orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, exportFn } from '@/common/constant'
export default { export default {
name: 'orderManage', name: 'orderManage',
data() { data() {
...@@ -123,11 +123,13 @@ export default { ...@@ -123,11 +123,13 @@ export default {
isEdit: true, isEdit: true,
orderCode: '', orderCode: '',
oldVal: { oldVal: {
orderStatuses: [] orderStatuses: [],
afterSaleStatuses: []
}, },
searchForm: { searchForm: {
orderCode: '', orderCode: '',
orderStatuses: [], orderStatuses: [],
afterSaleStatuses: [],
merchantName: '', merchantName: '',
customerName: '', customerName: '',
createDate: [], createDate: [],
...@@ -137,7 +139,8 @@ export default { ...@@ -137,7 +139,8 @@ export default {
tableSearchForm: {}, tableSearchForm: {},
statisticsInfo: { statisticsInfo: {
orderCount: '', orderCount: '',
payPriceTotal: '' payPriceTotal: '',
refundTotal: ''
}, },
// 搜索 // 搜索
searchFormData1: [ searchFormData1: [
...@@ -154,7 +157,7 @@ export default { ...@@ -154,7 +157,7 @@ export default {
optionList: [], optionList: [],
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionsName: 'orderStatusList', optionsName: 'searchOrderStatusList',
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
var isAdd = value.length > this.oldVal.orderStatuses.length var isAdd = value.length > this.oldVal.orderStatuses.length
var targetVal = value[value.length - 1] var targetVal = value[value.length - 1]
...@@ -179,13 +182,45 @@ export default { ...@@ -179,13 +182,45 @@ export default {
} }
}, },
{ {
label: '售后状态',
name: 'afterSaleStatuses',
type: 'select',
multiple: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'searchAfterSaleStatusList',
changeAttr: (value, targetItem) => {
var isAdd = value.length > this.oldVal.afterSaleStatuses.length
var targetVal = value[value.length - 1]
if (!isAdd) {
for (var i = 0; i < this.oldVal.afterSaleStatuses.length; i++) {
if (!value.includes(this.oldVal.afterSaleStatuses[i])) {
targetVal = this.oldVal.afterSaleStatuses[i]
break
}
}
}
!targetVal && (this.searchForm.afterSaleStatuses = isAdd ? this.searchFormData1[2].optionList.map(item => item.confId) : [])
if (targetVal) {
var idx = value.findIndex(item => item == '')
if (idx != -1 && this.searchForm.afterSaleStatuses.length < this.searchFormData1[2].optionList.length) {
this.searchForm.afterSaleStatuses.splice(idx, 1)
} else if (idx == -1 && this.searchForm.afterSaleStatuses.length == this.searchFormData1[2].optionList.length - 1) {
this.searchForm.afterSaleStatuses.push('')
}
}
this.oldVal.afterSaleStatuses = this.$common.utils.deepClone(this.searchForm.afterSaleStatuses)
}
}
],
searchFormData2: [
{
label: '门店', label: '门店',
name: 'merchantName', name: 'merchantName',
type: 'input', type: 'input',
labelWidth: 56 labelWidth: 56
} },
],
searchFormData2: [
{ {
label: '客户姓名', label: '客户姓名',
name: 'customerName', name: 'customerName',
...@@ -197,7 +232,9 @@ export default { ...@@ -197,7 +232,9 @@ export default {
type: 'datePicker', type: 'datePicker',
isClear: true, isClear: true,
pickerOptions: 'beforeRangePickerOptions' pickerOptions: 'beforeRangePickerOptions'
}, }
],
searchFormData3: [
{ {
label: '订单类型', label: '订单类型',
name: 'orderSource', name: 'orderSource',
...@@ -206,9 +243,7 @@ export default { ...@@ -206,9 +243,7 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionsName: 'orderSourceList' optionsName: 'orderSourceList'
} },
],
searchFormData3: [
{ {
label: '结算方式', label: '结算方式',
name: 'deliveryType', name: 'deliveryType',
...@@ -340,7 +375,7 @@ export default { ...@@ -340,7 +375,7 @@ export default {
label: '支付总价', label: '支付总价',
prop: 'payPrice', prop: 'payPrice',
formatter: cellValue => { formatter: cellValue => {
return cellValue.payPrice || '-' return cellValue.payPrice || '0'
} }
}, },
{ {
...@@ -357,6 +392,14 @@ export default { ...@@ -357,6 +392,14 @@ export default {
} }
}, },
{ {
label: '售后状态',
prop: 'afterSaleStatus',
width: '80',
formatter: cellValue => {
return this.baseData.afterSaleStatusList.map(item => item.confId).includes(cellValue.afterSaleStatus + '') ? this.baseData.afterSaleStatusList.find(item => item.confId == cellValue.afterSaleStatus).confName : '-'
}
},
{
label: '结算方式', label: '结算方式',
prop: 'deliveryType', prop: 'deliveryType',
width: '80', width: '80',
...@@ -369,7 +412,10 @@ export default { ...@@ -369,7 +412,10 @@ export default {
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据 // 基本数据
baseData: { baseData: {
searchOrderStatusList: orderManageStatusList.filter(item => ['1', '3', '21', '22', '6', '9'].includes(item.confId)),
searchAfterSaleStatusList: afterSaleStatusList.filter(item => ['1', '6', '7'].includes(item.confId)),
orderStatusList: orderManageStatusList, orderStatusList: orderManageStatusList,
afterSaleStatusList: afterSaleStatusList,
orderSourceList: orderSourceList, orderSourceList: orderSourceList,
deliveryTypeList: deliveryTypeList, deliveryTypeList: deliveryTypeList,
refundTypeList: [ refundTypeList: [
...@@ -462,7 +508,7 @@ export default { ...@@ -462,7 +508,7 @@ export default {
var params = this.getParams() var params = this.getParams()
delete params.createDate delete params.createDate
this.$apis.orderManage.getCountApi(params).then(res => { this.$apis.orderManage.getCountApi(params).then(res => {
this.statisticsInfo = res || { orderCount: '', payPriceTotal: '' } this.statisticsInfo = res || { orderCount: '', payPriceTotal: '', refundTotal: '' }
}) })
}, },
...@@ -662,6 +708,7 @@ export default { ...@@ -662,6 +708,7 @@ export default {
this.searchForm = { this.searchForm = {
orderCode: '', orderCode: '',
orderStatuses: [], orderStatuses: [],
afterSaleStatuses: [],
merchantName: '', merchantName: '',
customerName: '', customerName: '',
createDate: [], createDate: [],
...@@ -675,36 +722,4 @@ export default { ...@@ -675,36 +722,4 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.marketing .el-tabs__nav-wrap:after {
opacity: 0;
}
.marketing .el-tabs__item {
height: 20px !important;
line-height: 10px !important;
}
.marketing .el-tabs__item {
width: 120px;
height: 40px !important;
line-height: 40px !important;
font-size: 14px;
text-align: center;
border: 0 !important;
background: #FFFFFF;
color: #999999;
border-radius: 0px 4px 0px 0px;
border: 1px solid #F4F6FC;
padding: 0;
}
.marketing .el-tabs__active-bar {
display: none;
}
.marketing .el-tabs__header {
margin: 0 !important;
}
.marketing .el-tabs__item.is-active {
color: #5850ff;
background: #F4F6FC !important;
border-radius: 4px 0px 0px 0px;
border: 1px solid #F4F6FC !important;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!