Commit 097190dc by 杨明

Merge branch 'master' of http://192.168.3.233:8090/saas/scrm-micro-marketing into v3.14.0

2 parents 95bef069 cf86c7f9
......@@ -53,15 +53,15 @@ export default {
}
},
created() {
document.onkeydown = function() {
var evt = window.event || arguments[0]
if (evt && evt.keyCode == 13) {
if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
if (typeof evt.stopPropagation == 'function') evt.stopPropagation()
return false
}
return true
}
// document.onkeydown = function() {
// var evt = window.event || arguments[0]
// if (evt && evt.keyCode == 13) {
// if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
// if (typeof evt.stopPropagation == 'function') evt.stopPropagation()
// return false
// }
// return true
// }
this.myMsg = this.msg
this.myMessage = this.message
}
......
......@@ -128,7 +128,8 @@ const orderSourceList = [
{ confId: '1', confName: '商城订单' },
{ confId: '2', confName: '直播订单' },
{ confId: '3', confName: '秒杀订单' },
{ confId: '4', confName: '众筹订单' }
{ confId: '4', confName: '众筹订单' },
{ confId: '6', confName: '配置升级订单' }
]
const deliveryTypeList = [
......@@ -212,6 +213,14 @@ const memberTypeList = [
{
confId: 2,
confName: '试用会员'
},
{
confId: 3,
confName: '金卡会员'
},
{
confId: 4,
confName: '银卡会员'
}
]
const stateList = [
......
......@@ -88,7 +88,7 @@ export default {
getList(page, isMounted = false) {
var params = {
goodsStatus: 1,
goodsSource: 1,
goodsSources: [1,4],
currentPage: 1,
pageNum: 1,
pageSize: 100000,
......
......@@ -38,7 +38,8 @@ export async function bootstrap({history, common, messenger, globalState, router
secret,
sign_common,
request_common,
request_merchant
request_merchant,
merchantId
} = await fetchConfig(false)
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
......@@ -46,6 +47,7 @@ export async function bootstrap({history, common, messenger, globalState, router
Vue.prototype.$common = common
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$hmdMerchantId = merchantId
// 集团版集团账号
Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4
Vue.prototype.$http = new common.Http({
......
......@@ -117,6 +117,7 @@ export default {
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'
}
params.merchantId = this.$globalState.session.merchantId
delete params.createDate
return params
},
......
......@@ -24,9 +24,7 @@
<div :class="editForm.status == 3 ? 'darkColor' : ''" class="ctime">
<!-- <span class="ctime_name">使用限制:</span> -->
<span v-show="editForm.denomination" style="font-size: 12px;">¥</span>
<span class="ctime_content" style="font-size: 20px;font-weight: 600;" v-show="editForm.denomination">{{
editForm.denomination
}}</span>
<span class="ctime_content" style="font-size: 20px;font-weight: 600;" v-show="editForm.denomination">{{ editForm.denomination }}</span>
<span class="ctime_content">{{ editForm.useBarriers == 1 ? '无门槛' : '满' + editForm.full + '元可用' }}</span>
</div>
<div class="ccode">
......@@ -81,9 +79,9 @@
<br />
<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-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOption" :default-time="defaultTime" :format="format" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable>
</el-date-picker>
<el-date-picker v-model="editForm.effectiveTime" @click="getStartTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOption" :default-time="defaultTime" :format="format" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio>
<div class="el-form-item__error" v-if="isEffective">开始时间需大于当前时间</div>
</el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'">
......@@ -106,16 +104,15 @@
<template slot="denominationHtml">
<el-input v-model="editForm.denomination" id="denomination" placeholder="请输入面值" :disabled="apear != 'couponAdd'" @blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)"></el-input>
元
<span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{
selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券'
}}</span>
<span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{ selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券' }}</span>
</template>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span>
<div v-else>
<el-input :disabled="apear != 'couponAdd'" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
<el-input :disabled="apear != 'couponAdd' || isLimitStock" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
张
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="disabledContent" @change="updateStock">不限制库存</el-checkbox>
</div>
</template>
<!-- 只有使用途径为线上商品时才有效,到店核销时屏蔽 -->
......@@ -165,6 +162,9 @@ export default {
name: 'editCashCoupon',
data() {
return {
isHmd: true,
isEffective:false,
isLimitStock: false,
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
showSubmit: true,
......@@ -303,7 +303,7 @@ export default {
},
{
label: '库存',
name: 'stock',
name: !this.isLimitStock ? 'stock' : '',
addHtml: 'stock'
// width: '150px',
// type: 'input'
......@@ -324,7 +324,7 @@ export default {
addHtml: 'editHtml',
isHide: true
}
],
]
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -353,6 +353,13 @@ export default {
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.editRule.stock[0].required = !this.$isGroupUp
},
......@@ -466,11 +473,13 @@ export default {
'editForm.effectiveType'(newValue, oldValue) {
if (newValue == 3) {
this.isEffective = false
this.$refs['effectiveTime'].resetField()
this.$refs['effectiveDays'].resetField()
} else if (newValue == 2) {
this.$refs['effectiveDays'].resetField()
} else if (newValue == 1) {
this.isEffective = false
this.$refs['effectiveTime'].resetField()
}
},
......@@ -483,10 +492,15 @@ export default {
},
methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock = ''
},
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
})
this[editName] &&
this[editName].forEach(item => {
item.isDisabled = true
})
},
editCoupon(attribute) {
attribute.forEach(item => {
......@@ -495,10 +509,12 @@ export default {
})
},
haveChange() {
this.isEffective = false
let oDateOne = new Date(this.editForm.effectiveTime[0]).getTime()
let timeStamp = new Date().getTime()
if (oDateOne < timeStamp) {
this.editForm.effectiveTime = []
this.isEffective = true
// this.editForm.effectiveTime = []
}
},
// 编辑按钮
......@@ -520,7 +536,7 @@ export default {
pageSize: 100000,
pageStart: 0,
goodsStatus: 1,
goodsSource: 1,
goodsSources: [1, 4],
goodsName: ''
}
if (goodsName) {
......@@ -627,6 +643,10 @@ export default {
// if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// }
if (res.limitStockFlag == 2) {
this.isLimitStock = true
this.editRule.stock[0].required = false
}
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) {
......@@ -720,8 +740,8 @@ export default {
//面值
obj.denomination = form.denomination
//库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp || !this.isLimitStock) {
obj.stock = form.stock
}
// else {
......@@ -767,6 +787,9 @@ export default {
// merchantErrorObj = errorObj
// })
// }
if(this.isEffective){
return
}
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
}
......@@ -796,15 +819,16 @@ export default {
}
console.log(params)
this.loading = true
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
this.$apis.couponManage[method](params)
.then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
......@@ -826,7 +850,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {})
} else {
this.cancelJump()
}
......
......@@ -98,8 +98,11 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
张
<template v-else>
<el-input :disabled="apear != 'couponAdd' || isLimitStock" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
张
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="apear != 'couponAdd'" @change="updateStock">不限制库存</el-checkbox>
</template>
</template>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
......@@ -126,6 +129,8 @@ export default {
name: 'editDiscountCoupon',
data() {
return {
isHmd: true,
isLimitStock: false,
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
showSubmit: true,
......@@ -242,7 +247,7 @@ export default {
addHtml: 'editHtml',
isHide: true
}
],
]
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -271,6 +276,13 @@ export default {
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.editRule.stock[0].required = !this.$isGroupUp
},
......@@ -348,10 +360,15 @@ export default {
}
},
methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock = ''
},
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
})
this[editName] &&
this[editName].forEach(item => {
item.isDisabled = true
})
},
editCoupon(attribute) {
attribute.forEach(item => {
......@@ -399,6 +416,10 @@ export default {
// if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// }
if (res.limitStockFlag == 2) {
this.isLimitStock = true
this.editRule.stock[0].required = false
}
//使用限制,满多少元可用
if (this.editForm.useBarriers == 2) {
this.editForm.full = this.editForm.full
......@@ -475,8 +496,8 @@ export default {
obj.full = form.full
}
//库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp || !this.isLimitStock) {
obj.stock = form.stock
}
// else {
......@@ -529,15 +550,16 @@ export default {
method = 'createCouponApi' //后台创建优惠券
}
this.loading = true
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
this.$apis.couponManage[method](params)
.then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
......@@ -559,7 +581,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {})
} else {
this.cancelJump()
}
......
......@@ -57,9 +57,12 @@
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="$isGroupUp">无库存限制</span>
<el-input :disabled="apear != 'couponAdd'" v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<!-- <span slot="suffix">张</span> -->
</el-input>
<template v-else>
<el-input :disabled="apear != 'couponAdd' || isLimitStock" class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存">
<!-- <span slot="suffix">张</span> -->
</el-input>
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="apear != 'couponAdd'" @change="updateStock">不限制库存</el-checkbox>
</template>
</template>
<template slot="directionalFlagHtml">
<div>
......@@ -114,6 +117,8 @@ export default {
name: 'editDiscountCoupon',
data() {
return {
isHmd: true,
isLimitStock: false,
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
format: 'yyyy-MM-dd HH:mm:ss', // 日期显示格式
showSubmit: true,
......@@ -213,7 +218,7 @@ export default {
addHtml: 'editHtml',
isHide: true
}
],
]
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -242,6 +247,13 @@ export default {
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.editRule.stock[0].required = !this.$isGroupUp
},
......@@ -307,10 +319,15 @@ export default {
},
methods: {
updateStock(e) {
this.editRule.stock[0].required = !e
this.editForm.stock = ''
},
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
})
this[editName] &&
this[editName].forEach(item => {
item.isDisabled = true
})
},
editCoupon(attribute) {
attribute.forEach(item => {
......@@ -347,6 +364,10 @@ export default {
// if (this.$isGroupUp) {
// this.editForm.scopeApplication = this.editForm.scopeApplication + ''
// }
if (res.limitStockFlag == 2) {
this.isLimitStock = true
this.editRule.stock[0].required = false
}
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:永久有效
if (this.editForm.effectiveType == 2) {
......@@ -406,8 +427,8 @@ export default {
}
//库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp || !this.isLimitStock) {
obj.stock = form.stock
}
// else {
......@@ -458,15 +479,16 @@ export default {
method = 'createCouponApi' //后台创建优惠券
}
this.loading = true
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
this.$apis.couponManage[method](params)
.then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
if (res.code == '0') {
this.cancelJump()
}
})
.finally(() => {
this.loading = false
})
......@@ -488,7 +510,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {})
} else {
this.cancelJump()
}
......
......@@ -18,11 +18,19 @@
<!-- effectiveType:1, effectiveDays:5 -->
<el-radio :label="1" id="effectiveDays">
领取后
<el-input v-model="ruleForm.effectiveDays" maxlength="4" @input="
<el-input
v-model="ruleForm.effectiveDays"
maxlength="4"
@input="
val => {
ruleForm.effectiveDays = val.replace(/[^\d]/g, '')
}
" :disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 1" placeholder="请输入" size="small" style="width: 100px"></el-input>
"
:disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 1"
placeholder="请输入"
size="small"
style="width: 100px"
></el-input>
天内有效
</el-radio>
<!-- effectiveStartTime effectiveEndTime +具体时间 -->
......@@ -46,11 +54,19 @@
</el-radio>
<el-radio :label="2" id="limitDays">
有效期内每
<el-input v-model="ruleForm.limitDays" maxlength="4" @input="
<el-input
v-model="ruleForm.limitDays"
maxlength="4"
@input="
val => {
ruleForm.limitDays = val.replace(/[^\d]/g, '')
}
" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2" placeholder="请输入" size="small" style="width: 100px"></el-input>
"
:disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2"
placeholder="请输入"
size="small"
style="width: 100px"
></el-input>
天内可使用
<el-button @click.stop="sub2" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 2">-</el-button>
<span class="numWrap">{{ ruleForm.limitTime2 }}</span>
......@@ -69,12 +85,13 @@
元
</el-form-item>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<el-form-item size="small" label="库存:" prop="stock">
<el-form-item size="small" label="库存:" :prop="!isLimitStock ? 'stock' : ''">
<!-- <el-input size="small" :disabled="title == '查看'" maxlength="6" v-model.number="ruleForm.stock" placeholder="请输入"></el-input> -->
<span v-if="$isGroupUp">无库存限制</span>
<div v-else>
<el-input :disabled="title == '查看'" class="w-150" v-model="ruleForm.stock" placeholder="请输入库存"></el-input>
<el-input :disabled="title == '查看' || isLimitStock" class="w-150" v-model="ruleForm.stock" placeholder="请输入库存"></el-input>
张
<el-checkbox style="margin-left:10px;" v-if="!isHmd" v-model="isLimitStock" :disabled="title == '查看'" @change="updateStock">不限制库存</el-checkbox>
</div>
</el-form-item>
<el-form-item size="small" label="使用说明:" prop="useDescription">
......@@ -190,7 +207,7 @@ export default {
return callback(new Error('库存不能为空或负数'))
}
setTimeout(() => {
if (!(/^[0-9]*$/.test(value))) {
if (!/^[0-9]*$/.test(value)) {
callback(new Error('请输入数字值'))
} else {
if (value < 0) {
......@@ -202,7 +219,9 @@ export default {
}, 1000)
}
return {
isHmd: true,
timer: Function,
isLimitStock: false,
isEdit: false,
showSubmit: true,
disabledDescription: false,
......@@ -228,7 +247,8 @@ export default {
shopPrice: '',
stock: '',
useDescription: '',
daterange: []
daterange: [],
limitStockFlag: 1
// scopeApplication: ''
},
copyRuleForm: {},
......@@ -254,7 +274,7 @@ export default {
},
merchantId: '',
merchantName: '',
title: this.$route.query.title || '',
title: this.$route.query.title || ''
// 适用门店
// merchantRule: {
// scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
......@@ -317,6 +337,8 @@ export default {
this.merchantId = this.$globalState.session.merchantId
this.merchantName = this.$globalState.session.merchantName
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
if (this.title == '编辑' || this.title == '查看') {
this.isEdit = true
var breadcrumbTitle = this.title
......@@ -340,6 +362,9 @@ export default {
}
},
methods: {
updateStock(e) {
this.ruleForm.stock = ''
},
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
......@@ -357,9 +382,9 @@ export default {
this.ruleForm = res
this.ruleForm.anticipatedCost = (res.anticipatedCost / 100).toFixed(2)
this.ruleForm.customUseLimit = res.useType
// if (this.$isGroupUp) {
// this.ruleForm.scopeApplication = res.scopeApplication + ''
// }
if (res.limitStockFlag == 2) {
this.isLimitStock = true
}
if (res.effectiveType == 1) {
this.ruleForm.effectiveDays = res.effectiveDays
}
......@@ -467,8 +492,8 @@ export default {
params.shopPrice = this.ruleForm.shopPrice
// params.stock = this.ruleForm.stock
//库存
params.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
params.limitStockFlag = this.$isGroupUp || this.isLimitStock ? 2 : 1
if (!this.$isGroupUp || !this.isLimitStock) {
params.stock = this.ruleForm.stock
}
// else {
......
......@@ -5,14 +5,14 @@
<p class="edit-title">{{ title }}</p>
<glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="giftTypeSlot">
<div :style="{cursor : routeInfo.receivedStock ? 'not-allowed':'pointer'}" :class="['gift-type',{'active-gift': merchantType==item.value}]" v-for="item in giftTypeList" :key="item.value" @click="changeMerchantType(item.value)">
{{item.name}}
<div :style="{ cursor: routeInfo.receivedStock ? 'not-allowed' : 'pointer' }" :class="['gift-type', { 'active-gift': merchantType == item.value }]" v-for="item in giftTypeList" :key="item.value" @click="changeMerchantType(item.value)">
{{ item.name }}
</div>
</div>
<div slot="remarkName" class="edit-tips m-t-8">可根据备注名称进行查找,仅作内部查看,不展示给客户</div>
<el-button slot="selectGiftBtn" :disabled="routeInfo.receivedStock" class="default-blue-btn" @click="handleGiftAdd">选择礼包内容</el-button>
<div style="width: 878px;" slot="selectGroupGiftSlot">
<el-radio :disabled="routeInfo.receivedStock" v-for="(item,index) in groupList" :key="index" v-model="groupDirectionalGiftId" :label="item.id">{{item.name}}</el-radio>
<el-radio :disabled="routeInfo.receivedStock" v-for="(item, index) in groupList" :key="index" v-model="groupDirectionalGiftId" :label="item.id">{{ item.name }}</el-radio>
</div>
<div slot="couponListBlock" class="gift-block" :style="{ 'margin-left': defaultLabelWidth }" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title">
......@@ -29,7 +29,7 @@
<span :class="['circle', subItem.status == '3' ? ' grey' : '']"></span>
<p :class="['gift-coupon-name', subItem.status == '3' ? ' txt-grey' : '']">{{ subItem.couponName }} × {{ subItem.couponAmount }}</p>
<p v-show="subItem.status == '3'" class="gift-tips">已失效</p>
<i v-if="merchantType==1" :style="{ cursor: routeInfo.receivedStock ? 'not-allowed' : 'pointer' }" class="el-icon-delete" style="color: #C6C6C6;" @click="handleGiftDelete(item, subIndex)"></i>
<i v-if="merchantType == 1" :style="{ cursor: routeInfo.receivedStock ? 'not-allowed' : 'pointer' }" class="el-icon-delete" style="color: #C6C6C6;" @click="handleGiftDelete(item, subIndex)"></i>
</div>
</div>
</div>
......@@ -70,6 +70,18 @@
</div>
</div>
</div>
<div slot="giveMemberFlag" v-if="isHmd">
<div style="display:flex">
<el-switch v-model="giveMemberFlag" active-text="开" inactive-text="关" @change="changeGiveMember"></el-switch>
<span class="edit-tips" v-show="editForm.giveMemberFlag == 2">领取该礼包后赠送1年</span>
</div>
<template v-if="editForm.giveMemberFlag == 2">
<el-radio-group v-model="editForm.giveMemberType" class="mt-10">
<el-radio v-for="(item, index) in memberList" :key="index" @click.native.prevent="changeRadio(item.label)" :label="item.label">{{ item.name }}</el-radio>
</el-radio-group>
<div class="el-form-item__error" v-if="isGiveMemberType">请选择会员类型</div>
</template>
</div>
<span slot="bubble">
<el-popover placement="top-start" width="200" trigger="hover" content="创建礼包时指定好领取条件,客户需正确输入领取条件方可成功领取">
<i slot="reference" class="el-icon-question" style="color: #C6C6C6;"></i>
......@@ -146,6 +158,8 @@ export default {
name: 'editGift',
data() {
return {
isGiveMemberType: false,
isHmd: true,
phone: '',
isLoaded: true,
loading: false,
......@@ -184,8 +198,11 @@ export default {
couponList: [],
stock: 1,
approveFlag: 1,
receiveRule: 1
receiveRule: 1,
giveMemberFlag: 2,
giveMemberType: ''
},
giveMemberFlag: true,
totalEstimatedCost: '',
orderShow: ['service', 'cash', 'discount', 'exchange'],
numToCoupon: {
......@@ -230,6 +247,20 @@ export default {
value: 2
}
],
memberList: [
{
label: 1,
name: '普通会员'
},
{
label: 2,
name: '银卡会员'
},
{
label: 3,
name: '金卡会员'
}
],
editRule: {
name: [{ required: true, message: '请输入礼包名称', trigger: 'change' }],
remarkName: [{ required: true, message: '请输入备注名称', trigger: 'change' }],
......@@ -277,8 +308,8 @@ export default {
editFormData: [
{
label: '礼包类型',
name:'',
addHtml:'giftTypeSlot',
name: '',
addHtml: 'giftTypeSlot',
isHide: false
},
{
......@@ -305,7 +336,7 @@ export default {
isHide: false
},
{
label:'选择礼包',
label: '选择礼包',
name: 'couponList',
addHtml: 'selectGroupGiftSlot',
isHide: true
......@@ -365,6 +396,12 @@ export default {
this.resetTextArea()
}
},
{
label: '会员赠送',
name: 'giveMemberFlag',
addHtml: 'giveMemberFlag',
isHide: false
},
// {
// label: '领取条件',
// name: 'receiveWay',
......@@ -426,7 +463,7 @@ export default {
currentCoupons: [],
currentPeople: [],
groupDirectionalGiftId: '',
groupList:[]
groupList: []
}
},
components: {
......@@ -441,16 +478,16 @@ export default {
deep: true
},
merchantType: {
handler(val){
handler(val) {
let target = this.editFormData.find(item => item.addHtml == 'selectGroupGiftSlot')
let setGiftTarget = this.editFormData.find(item => item.addHtml == 'selectGiftBtn')
let nameTarget = this.editFormData.find(item => item.name == 'name')
target.isHide = val == 1
setGiftTarget.isHide = val != 1
nameTarget.isHide = val != 1
if(val == 2){
if (val == 2) {
this.groupDirectionalGiftId = this.groupList[0]?.id
}else{
} else {
this.editForm.name = ''
this.groupDirectionalGiftId = ''
}
......@@ -458,9 +495,9 @@ export default {
deep: true
},
groupDirectionalGiftId: {
handler(val){
if(this.merchantType == 2){
let target = this.groupList.find(item=> item.id == this.groupDirectionalGiftId)
handler(val) {
if (this.merchantType == 2) {
let target = this.groupList.find(item => item.id == this.groupDirectionalGiftId)
this.editForm.name = target.name
this.selectGroupGiftFn(target)
}
......@@ -484,6 +521,7 @@ export default {
this.editFormData[idx].isHide = newValue == 4
this.editFormData[idxx].isHide = newValue == 4
this.editFormData[idxxx].isHide = newValue == 4
if (newValue == 4) {
this.editForm.staffList = []
this.editForm.stock = 1
......@@ -495,9 +533,18 @@ export default {
return `请输入领取${this.receiveWay == 1 ? '手机号' : '车架号后6位'},多个${this.receiveWay == 1 ? '手机号' : '车架号'}以换行符隔开`
}
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
},
mounted() {
this.setMinHeight()
this.getGroupGift()
this.dynamicHmd()
this.routeInfo = this.$route.query
if (this.routeInfo.receivedStock) this.routeInfo.receivedStock = +this.routeInfo.receivedStock
this.title = this.titleObj[this.routeInfo.addOrEdit]
......@@ -514,10 +561,26 @@ export default {
}
},
methods: {
changeMerchantType(val){
if(this.routeInfo.receivedStock) return;
changeRadio(e) {
this.isGiveMemberType = false
if (this.editForm.giveMemberType == e) {
this.editForm.giveMemberType = ''
} else {
this.editForm.giveMemberType = e
}
},
changeGiveMember(e) {
this.editForm.giveMemberFlag = e ? 2 : 1
this.editForm.giveMemberType = ''
},
dynamicHmd() {
let giveMemberFlagId = this.editFormData.findIndex(item => item.name == 'giveMemberFlag')
this.editFormData[giveMemberFlagId].isHide = !this.isHmd
},
changeMerchantType(val) {
if (this.routeInfo.receivedStock) return
this.merchantType = val
if(val==1){
if (val == 1) {
this.orderShow.forEach(item => {
this.couponObj[item].list = []
})
......@@ -525,34 +588,37 @@ export default {
this.hasCouponBlock(false)
}
},
getGroupGift(){
getGroupGift() {
this.loading = true
this.$apis.giftBag.getGroupGift({}).then(res => {
let giftArr = []
if(res?.length){
let Obj = this.$common.utils.deepClone(this.couponObj)
this.orderShow.forEach(item => {
Obj[item].list = []
})
res.forEach(ele => {
let gift = this.$common.utils.deepClone(Obj)
console.log(JSON.stringify(Obj))
const {id, name, couponDTOList} = ele
couponDTOList.forEach(item=>{
gift[this.numToCoupon[item.discountType]].list.push(item)
this.$apis.giftBag
.getGroupGift({})
.then(res => {
let giftArr = []
if (res?.length) {
let Obj = this.$common.utils.deepClone(this.couponObj)
this.orderShow.forEach(item => {
Obj[item].list = []
})
giftArr.push({id, name, gift})
})
this.groupList = this.$common.utils.deepClone(giftArr)
}else{
let target = this.editFormData.find(item => item.addHtml == 'giftTypeSlot')
target.isHide = true
}
}).finally(end =>{
this.loading = false
})
res.forEach(ele => {
let gift = this.$common.utils.deepClone(Obj)
console.log(JSON.stringify(Obj))
const { id, name, couponDTOList } = ele
couponDTOList.forEach(item => {
gift[this.numToCoupon[item.discountType]].list.push(item)
})
giftArr.push({ id, name, gift })
})
this.groupList = this.$common.utils.deepClone(giftArr)
} else {
let target = this.editFormData.find(item => item.addHtml == 'giftTypeSlot')
target.isHide = true
}
})
.finally(end => {
this.loading = false
})
},
selectGroupGiftFn(item){
selectGroupGiftFn(item) {
let gift = this.$common.utils.deepClone(item.gift)
this.handleGiftConfirm(gift, 'group')
},
......@@ -611,7 +677,8 @@ export default {
this.editForm = res.data
this.curStock = res.data.stock
this.merchantType = res.data.merchantType
this.$nextTick(()=>{
if (this.editForm.giveMemberFlag == 1) this.giveMemberFlag = false
this.$nextTick(() => {
this.groupDirectionalGiftId = res.data.groupDirectionalGiftId
})
this.curReceiveRule = res.data.receiveRule
......@@ -696,8 +763,8 @@ export default {
this.handleGiftClose()
},
handleGiftConfirm(selectedData, type) {
console.log(selectedData,'selectedData')
if(type!='group'){
console.log(selectedData, 'selectedData')
if (type != 'group') {
this.handleGiftClose()
}
this.couponObj = selectedData
......@@ -753,16 +820,28 @@ export default {
params.staffCreateRequests = this.$common.utils.deepClone(params.staffList)
params.couponCreateRequests = this.$common.utils.deepClone(params.couponList)
params.couponCreateRequests.forEach(item => {
item.couponId = this.merchantType==2 ? item.couponId: item.id
item.couponId = this.merchantType == 2 ? item.couponId : item.id
})
if (this.editForm.receiveRule == 1 || this.editForm.receiveRule == 4) {
params.receiveDetailList = this.phoneList.map(item => item.tel)
let maxLength = 500
let maxLength = 1000
if (params.receiveDetailList && params.receiveDetailList.length > maxLength) {
return this.$message.error(`领取${this.receiveWay == 1 ? '手机号' : '车架号'}不能超过${maxLength}个`)
}
params.receiveWay = this.receiveWay
}
if (!this.isHmd) {
delete params.giveMemberFlag
delete params.giveMemberType
} else {
if (this.editForm.giveMemberFlag == 1) delete params.giveMemberType //giveMemberFlag=2时传值
if (this.editForm.giveMemberFlag == 2 && this.editForm.giveMemberType == '') {
console.log(333)
this.isGiveMemberType = true
return
}
}
delete params.staffList
delete params.couponList
if (this.routeInfo.addOrEdit == 'edit') {
......@@ -775,7 +854,7 @@ export default {
}
params.requestSource = 1
params.merchantType = this.merchantType
if(this.merchantType==2) params.groupDirectionalGiftId = this.groupDirectionalGiftId
if (this.merchantType == 2) params.groupDirectionalGiftId = this.groupDirectionalGiftId
// 插入判断是否存在审批模板
// const { session } = this.$globalState
if (this.editForm.receiveRule == 1 || this.editForm.receiveRule == 4) {
......@@ -783,6 +862,7 @@ export default {
return this.$message.error(`${this.editForm.receiveRule == 1 ? '领取条件不能为空!' : '用户手机号不能为空!'}`)
}
}
this.insertHttp(params)
// this.$apis.giftBag.templateModal({ merchantId: session.merchantId }).then(result => {
// if (result.data && (!this.isChangeCoupons || !this.isChangePeople)) {
......@@ -886,9 +966,9 @@ export default {
}
}
.gift-type{
.gift-type {
display: inline-block;
border: 1px solid #D5D5D5;
border: 1px solid #d5d5d5;
box-sizing: border-box;
text-align: center;
width: 70px;
......@@ -896,12 +976,12 @@ export default {
line-height: 20px;
font-weight: 400;
font-size: 12px;
color: rgba(0,0,0,0.65);
color: rgba(0, 0, 0, 0.65);
cursor: pointer;
}
.active-gift{
background: #5850FF;
border: 1px solid #5850FF;
.active-gift {
background: #5850ff;
border: 1px solid #5850ff;
color: #fff;
}
.approval-tip {
......
......@@ -18,7 +18,10 @@
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form v-loading="loading" class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="415px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="giftNameSlot" class="gift-name-slot">{{editForm.name}} <div class="group-label" v-if="editForm.merchantType==2">集团</div></div>
<div slot="giftNameSlot" class="gift-name-slot">
{{ editForm.name }}
<div class="group-label" v-if="editForm.merchantType == 2">集团</div>
</div>
<div slot="couponListBlock" class="gift-block" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-title">
预估成本:
......@@ -45,11 +48,15 @@
<div slot="receiveDetails" :class="editForm.receiveRule == 4 ? 'user' : ''">
<span v-if="editForm.receiveRule == 2 && editForm.receiveWay && editForm.receiveDetails">{{ `${editForm.receiveWay == '1' ? '手机号:' : '车架号后6位:'}${editForm.receiveDetails}` }}</span>
<span v-if="editForm.receiveRule == 1">{{ editForm.receiveWay == '1' ? '指定手机号' : '指定车架号后6位' }}:</span>
<span v-if="editForm.receiveRule == 4"><span style="color: #f56c6c;margin-right: 4px;">*</span>用户手机号:</span>
<span v-if="editForm.receiveRule == 4">
<span style="color: #f56c6c;margin-right: 4px;">*</span>
用户手机号:
</span>
<div v-if="editForm.receiveRule == 1 || editForm.receiveRule == 4" class="phone-wrap">
<span :class="['phone', editForm.receiveWay == 1 ? 'realTel' : 'realNum']" v-for="(item, id) in receiveDetailList" :key="id">{{ item }}</span>
</div>
</div>
<div slot="staffListBlock" class="sale-select" v-show="editForm.staffList && editForm.staffList.length != 0">
<div :key="key" class="el-input-tag input-tag-wrapper-detail">
<el-tag effect="plain" type="info" v-for="(tag, idx) in editForm.staffList" :key="idx" :disable-transitions="false" @close="handleStaffRemove(tag, idx)">
......@@ -58,6 +65,10 @@
</el-tag>
</div>
</div>
<div slot="giveMemberFlag" v-if="isHmd">
<span class="form-label">会员赠送:</span>
{{ editForm.giveMemberType == 1 ? '普通会员' : editForm.giveMemberType == 2 ? '银卡会员' : '金卡会员' }}
</div>
</glsx-combi-form>
<div class="approval_note_container">
<div class="line"></div>
......@@ -85,6 +96,7 @@ export default {
name: 'giftDetail',
data() {
return {
isHmd: true,
size: 'small',
title: '礼包详情',
loading: false,
......@@ -150,7 +162,7 @@ export default {
staffList: [{ required: true, message: '请选择发放员工', trigger: 'change' }],
approveFlag: [{ required: true, message: '请选择审批要求', trigger: 'change' }],
stock: [{ required: true, message: '请选择库存数量', trigger: 'change' }],
receiveRule: [{ required: true, message: '请选择领取规则设置', trigger: 'change' }],
receiveRule: [{ required: true, message: '请选择领取规则设置', trigger: 'change' }]
},
isEdit: true,
editFormData: [
......@@ -181,7 +193,7 @@ export default {
addHtml: 'approveFlagBlock',
isHide: false
},
{
{
label: '领取规则设置',
name: 'receiveRule',
type: 'radio',
......@@ -209,13 +221,19 @@ export default {
confName: '直接发送到小程序卡包',
suffixSonSlot: 'cardHolder'
}
]},
]
},
{
label: '',
name: 'receiveWay',
addHtml: 'receiveDetails'
},
{
label: '',
name: 'giveMemberFlag',
addHtml: 'giveMemberFlag'
},
{
label: '发放员工',
name: 'staffList',
addHtml: 'staffListBlock'
......@@ -232,7 +250,14 @@ export default {
approvalStatusColor: ['#FF6D00', '#2CCA74', '#EB4E4E', '#999999', '#999999']
}
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
},
mounted() {
this.setMinHeight()
this.routeInfo = this.$route.query
......@@ -249,13 +274,14 @@ export default {
res.data.createdDate = dayjs(res.data.createdDate).format('YYYY-MM-DD HH:mm:ss')
res.data.updatedDate = dayjs(res.data.updatedDate).format('YYYY-MM-DD HH:mm:ss')
this.editForm = res.data
if(res?.data?.receiveRule == 4){
console.log(this.editForm)
if (res?.data?.receiveRule == 4) {
let target = this.editFormData.find(item => item.name == 'stock')
let targets = this.editFormData.find(item => item.name == 'approveFlag')
target.isHide = true
targets.isHide = true
}
if(res?.data?.receiveRule == 1){
if (res?.data?.receiveRule == 1) {
let targetss = this.editFormData.find(item => item.name == 'receiveWay')
targetss.label = '领取条件'
}
......@@ -321,38 +347,38 @@ export default {
border: 1px solid #e5e5e5;
}
.detail-page {
#receiveRule{
.el-radio-group{
#receiveRule {
.el-radio-group {
.is-checked {
.el-radio__input.is-checked .el-radio__inner{
border-color:#5850ff;
&::after{
background-color: #5850ff;
}
.el-radio__input.is-checked .el-radio__inner {
border-color: #5850ff;
&::after {
background-color: #5850ff;
}
}
}
.el-radio__label{
color: #333333!important;
.el-radio__label {
color: #333333 !important;
}
}
}
}
.marketing.edit-gift {
// 礼包
.gift-name-slot{
.gift-name-slot {
display: flex;
align-items: center;
.group-label{
.group-label {
width: 42px;
height: 20px;
line-height: 20px;
text-align: center;
background: rgba(255,101,61,0.15);
background: rgba(255, 101, 61, 0.15);
border-radius: 4px;
margin-left: 4px;
font-size: 12px;
display: inline-block;
color: #FF653D;
color: #ff653d;
}
}
.gift-block {
......@@ -531,4 +557,10 @@ export default {
.user {
margin-left: 144px;
}
.form-label {
width: 154px;
color: #666666;
display: inline-block;
text-align: right;
}
</style>
<template>
<div class="marketing live-room">
<div class="memberCardWrap" v-if="showGh || !(merchantModel == 2 && accountLevel == 1)">
<div class="memberCardWrap" v-if="!isHmd && (showGh || !(merchantModel == 2 && accountLevel == 1))">
<div class="cardBoxWrap">
<img src="@/assets/memberCard.png" alt="" />
<div class="memberCardName">{{ ruleForm.cardName }}</div>
......@@ -9,9 +9,6 @@
<div class="flex-1">
<p class="text-16 weight-6">
{{ ruleForm.cardName }}
<!-- <el-tooltip content="会员已包含基础权益:生活权益、商城折扣" effect="light" placement="top">
<img class="icon-circle-question" src="@/assets/icon-circle-question.png" alt="" @click="isshow = true" />
</el-tooltip> -->
</p>
<template v-if="showGh">
<div class="member-card"><img src="@/assets/silver.png" alt="" /></div>
......@@ -61,14 +58,10 @@
</template>
<div class="pricesMerge">
<el-form-item label="售价/元:" size="small" prop="price" style="width: 300px">
<el-input v-model="ruleForm.price" size="small" style="width: 136px" placeholder="请输入售价" @keyup.native="ruleForm.price = oninput(ruleForm.price)">
<!-- <span slot="suffix" class="suffix-label">元</span> -->
</el-input>
<el-input v-model="ruleForm.price" size="small" style="width: 136px" placeholder="请输入售价" @keyup.native="ruleForm.price = oninput(ruleForm.price)"></el-input>
</el-form-item>
<el-form-item label="市场价/元:" prop="marketPrice" size="small" style="width: 300px">
<el-input v-model="ruleForm.marketPrice" size="small" style="width: 136px" placeholder="请输入市场价" @keyup.native="ruleForm.marketPrice = oninput(ruleForm.marketPrice)">
<!-- <span slot="suffix" class="suffix-label">元</span> -->
</el-input>
<el-input v-model="ruleForm.marketPrice" size="small" style="width: 136px" placeholder="请输入市场价" @keyup.native="ruleForm.marketPrice = oninput(ruleForm.marketPrice)"></el-input>
</el-form-item>
</div>
<el-form-item :class="!ruleForm.tryNum ? 'is-error' : ''" class="memberTrial" label="会员卡试用" size="small">
......@@ -81,7 +74,6 @@
</div>
<div class="el-form-item__error trialDays_error" v-if="ruleForm.tryAble == 1 && !ruleForm.tryNum">请输入试用时长</div>
</div>
<!-- <div v-if="ruleForm.tryAble" class="promoteQR">生成小程序码推广</div> -->
</el-form-item>
</el-form>
<div style="display: flex">
......@@ -91,6 +83,34 @@
</div>
</div>
</div>
<div class="hmdMemberWrap flex-between" v-if="isHmd">
<div class="member" v-for="(i, index) in memberList" :key="index">
<div class="member-title">{{ i.type }}</div>
<div class="member-info" :style="{ 'background-image': `url(${i.bgImg})` }">
<div class="member-name">{{ memberDetailForm[i.memberName] }}</div>
</div>
<div class="member-footer">
<template v-if="!i.isEdit">
<div class="member-footer-name">
{{ memberDetailForm[i.memberName] }}
<img src="@/assets/editBlue.png" class="editIcon" @click="handleEdit(index)" alt="" />
</div>
<div class="member-price" v-if="index == 0">售价:¥{{ memberDetailForm[i.price] }}</div>
</template>
<template v-if="i.isEdit">
<div class="edit-member">
<el-input v-model="memberDetailForm[i.memberName]" :placeholder="i.memberName" maxlength="15"></el-input>
<i class="el-icon-check" @click="handleUpdateName(index)"></i>
</div>
<div class="edit-price" v-if="index == 0">
售价:
<el-input v-model="memberDetailForm[i.price]" @keyup.native="memberDetailForm[i.price] = oninput(memberDetailForm[i.price])"></el-input>
</div>
</template>
</div>
</div>
</div>
<div class="pageTitle">会员用户</div>
<div class="live-room container">
<GLCombiForm class="p-t-20" ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
......@@ -102,7 +122,10 @@
<div slot="cardInfo" slot-scope="scope">
<GLTable class="centerTable" ref="cardListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="cardParams" :tableData="scope.scope.list">
<div slot="activeTypeDesc" slot-scope="scope">
<div>{{ scope.scope.activeTypeDesc }}<span v-if="scope.scope.exchangeCode">({{scope.scope.exchangeCode}})</span></div>
<div>
{{ scope.scope.activeTypeDesc }}
<span v-if="scope.scope.exchangeCode">({{ scope.scope.exchangeCode }})</span>
</div>
</div>
</GLTable>
</div>
......@@ -175,6 +198,7 @@ export default {
},
data() {
return {
isHmd: true,
mode: 'mid',
hasFooter: false,
showGh: false,
......@@ -182,12 +206,14 @@ export default {
QRurl: '',
QRcode: ''
}, //推广
memberDetailForm: {},
isQRVisible: false,
size: 'small',
getListApi: getCenterListApi,
searchForm: {
userInfo: '',
status: '',
merchantName: '',
memberType: '',
activeType: '',
......@@ -291,7 +317,7 @@ export default {
{
label: '开通方式',
prop: 'activeTypeDesc',
addHtml:'activeTypeDesc',
addHtml: 'activeTypeDesc',
width: 200
},
{
......@@ -366,7 +392,28 @@ export default {
merchantData: {},
merchantId: 0, //记得改 glsxadmin:44184606
merchantModel: 1, //集团:1,门店:2
accountLevel: 0 //1,2,3,4工厂,省代,市代,门店
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
memberList: [
{
type: '普通会员',
memberName: 'cardClassName',
isEdit: false,
price: 'goodPrice',
bgImg: require('../../assets/center/general.png')
},
{
type: '银卡会员',
memberName: 'silverName',
isEdit: false,
bgImg: require('../../assets/center/silver.png')
},
{
type: '金卡会员',
memberName: 'goldName',
isEdit: false,
bgImg: require('../../assets/center/gold.png')
}
]
}
},
created() {
......@@ -378,7 +425,10 @@ export default {
}
// 取消判断
this.showGh = window.location.host.indexOf('cgacar') != -1
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
if (this.showGh) this.judgeGh()
if (this.isHmd) this.addMemberTypeList()
this.getCardContentFun()
this.getCardtypeList()
},
......@@ -386,6 +436,29 @@ export default {
this.getOptionsList('searchFormData')
},
methods: {
handleEdit(index) {
this.memberList[index].isEdit = true
},
handleUpdateName(index) {
let params = {}
this.memberList[index].isEdit = false
params.equityCardGrade = {
silverName: this.memberDetailForm.silverName,
goldName: this.memberDetailForm.goldName,
id: this.memberDetailForm.id,
cardId: this.memberDetailForm.cardId
}
params.cardClassName = this.memberDetailForm.cardClassName
params.price = this.memberDetailForm.goodPrice
params.id = this.memberDetailForm.equityClassId
updateCardContent(params).then(res => {
if (!res) {
return
}
this.$message.success('修改成功')
this.getCardContentFun()
})
},
judgeGh() {
this.baseData.openModeList.push(
{
......@@ -509,20 +582,59 @@ export default {
str = str.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/, '$1') // 小数点后只能输 2 位
return str
},
addMemberTypeList() {
this.baseData.memberTypeLists.push(
{
dictValue: 3,
dictLabel: '金卡会员'
},
{
dictValue: 4,
dictLabel: '银卡会员'
}
)
this.baseData.openModeList.push({
dictValue: 17,
dictLabel: '通过礼包赠送'
})
},
getCardContentFun() {
if (this.merchantModel == 2 && this.accountLevel == 1) return
if (this.isHmd) {
this.getHmdCardInfo()
} else {
if (this.merchantModel == 2 && this.accountLevel == 1) return
getCardContent({ merchantId: this.merchantId }).then(res => {
if (!res) {
return
}
this.ruleForm.equityId = res.equityClassId
this.ruleForm.cardName = res.equityName
this.ruleForm.goldCardClassName = res.equityGoldName
this.ruleForm.price = res.goodPrice
this.ruleForm.marketPrice = res.marketPrice
this.ruleForm.linkUrl = res.freeUrl
this.ruleForm.tryNum = res.freeDay //新增试用时长
this.ruleForm.tryAble = res.tryAble //会员卡试用开关
})
}
},
getHmdCardInfo() {
//获取会员类型
getCardContent({ merchantId: this.merchantId }).then(res => {
if (!res) {
return
if (res) {
let data = {
...res,
...res.equityCardGrade,
cardClassName: res.equityName
}
this.memberDetailForm = data
// let list = ['equityName', 'silverName', 'goldName']
// this.memberList.forEach((item, index) => {
// item.memberName = data[list[index]]
// item.price ? (item.price = data.goodPrice) : ''
// })
}
this.ruleForm.equityId = res.equityClassId
this.ruleForm.cardName = res.equityName
this.ruleForm.goldCardClassName = res.equityGoldName
this.ruleForm.price = res.goodPrice
this.ruleForm.marketPrice = res.marketPrice
this.ruleForm.linkUrl = res.freeUrl
this.ruleForm.tryNum = res.freeDay //新增试用时长
this.ruleForm.tryAble = res.tryAble //会员卡试用开关
})
},
openEditWrap() {
......@@ -984,4 +1096,95 @@ export default {
cursor: pointer;
}
}
/*海马刀样式 */
.hmdMemberWrap {
padding: 20px 62px 0 62px;
background: #fff;
.member {
&-title {
font-size: 14px;
color: #333333;
letter-spacing: 0.7px;
line-height: 20px;
margin-bottom: 6px;
}
&-info {
width: 300px;
height: 152px;
background-size: 100%;
overflow: hidden;
margin-bottom: 10px;
}
&-name {
font-weight: 500;
font-size: 16px;
color: #ffffff;
letter-spacing: 2.1px;
margin: 20px 0 0 20px;
}
&-footer {
height: 80px;
.member-footer-name {
font-size: 14px;
color: #666666;
letter-spacing: 0.7px;
line-height: 20px;
display: flex;
align-items: center;
justify-content: center;
.editIcon {
width: 16px;
height: 16px;
margin-left: 4px;
}
}
.edit-member {
display: flex;
align-items: center;
justify-content: center;
.el-input {
height: 32px;
max-width: 120px;
/deep/.el-input__inner {
height: 32px;
}
}
.el-icon-check {
font-weight: bold;
color: #5850ff;
width: 13.56px;
height: 11.37px;
margin-left: 8px;
cursor: pointer;
}
}
.member-price {
font-size: 12px;
color: #333333;
margin-top: 2px;
display: flex;
align-items: center;
justify-content: center;
}
.edit-price {
font-size: 12px;
color: #333333;
display: flex;
align-items: center;
justify-content: center;
margin-top: 8px;
.el-input {
height: 24px;
max-width: 64px;
margin-left: 6px;
/deep/.el-input__inner {
height: 24px;
}
}
}
}
}
}
</style>
......@@ -29,6 +29,12 @@
</div>
<div class="el-form-item__error" v-if="setmealContentRules">请选择套餐</div>
</el-form-item>
<el-form-item size="small" label="会员专享:" v-if="isHmd" prop="memberPayFlags">
<el-checkbox-group v-model="ruleForm.memberPayFlags">
<el-checkbox v-for="(item, index) in memberList" :key="index" :label="item.name">{{ item.label }}</el-checkbox>
</el-checkbox-group>
<span class="give-tip" style=" margin: -15px 0 0 154px;">仅勾选的等级用户方可购买会员套餐</span>
</el-form-item>
<el-form-item label="赠送金卡会员:" prop="giveGoldFlag" v-if="showGh && accountLevel == 4">
<el-radio-group v-model="ruleForm.giveGoldFlag">
<el-radio :label="2">赠送</el-radio>
......@@ -113,6 +119,7 @@ export default {
}
}
return {
isHmd: true,
memberPrice: '', //会员卡价格
sloading: false,
ruleForm: {
......@@ -122,13 +129,15 @@ export default {
// couponList:[],
notes: '',
giveGoldFlag: '',
packageImg: ''
packageImg: '',
memberPayFlags: []
},
copyRuleForm: {}, //用于检查页面信息是否改动
rules: {
packageName: [{ required: true, message: '请输入套餐名称', trigger: 'blur' }],
packagePrice: [{ required: true, validator: validatePrice, trigger: 'blur' }],
giveGoldFlag: [{ required: true, message: '请选择金卡会员', trigger: 'change' }]
giveGoldFlag: [{ required: true, message: '请选择金卡会员', trigger: 'change' }],
memberPayFlags: [{ required: true, message: '请选择会员专享', trigger: 'change' }]
},
picOptions: {
width: '104px',
......@@ -142,8 +151,26 @@ export default {
key: 'sharePosterImg',
isClose: true
},
memberList: [
{
label: '普通用户',
name: 2
},
{
label: '普通会员',
name: 3
},
{
label: '银卡会员',
name: 4
},
{
label: '金卡用户',
name: 5
}
],
packageImgArr: [],
sharePosterImgArr:[],
sharePosterImgArr: [],
allItemList: [],
choseItemList: [], //['一年12次洗车券×1', '车身打蜡×2', '全车镀膜×1'],
copyChoseItemList: [], //用于检查页面信息是否改动
......@@ -223,6 +250,8 @@ export default {
this.merchantName = this.$globalState.session.merchantName
this.accountLevel = this.$globalState.session.accountLevel
}
// 判断是否是海马刀
this.isHmd = this.merchantId == this.$hmdMerchantId
this.showGh = window.location.host.indexOf('cgacar') != -1
if (this.showGh) {
this.getCardContentFun()
......@@ -312,8 +341,9 @@ export default {
item.couponAmount = item.serviceQuantity
item.id = item.serviceId
})
this.packageImgArr =res.data.packageImg? [res.data.packageImg]:[]
this.sharePosterImgArr =res.data.sharePosterImg? [res.data.sharePosterImg]:[]
!res.data.memberPayFlags ? (this.ruleForm.memberPayFlags = []) : ''
this.packageImgArr = res.data.packageImg ? [res.data.packageImg] : []
this.sharePosterImgArr = res.data.sharePosterImg ? [res.data.sharePosterImg] : []
this.recoveryCoupon()
this.copyTotalPrice = this.totalPrice
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
......@@ -363,12 +393,12 @@ export default {
param.packagePrice = this.ruleForm.packagePrice
param.notes = this.ruleForm.notes
param.switchStatus = this.ruleForm.switchStatus ? 1 : 0
if (this.isHmd) param.memberPayFlags = this.ruleForm.memberPayFlags
if (this.showGh) {
param.giveGoldFlag = this.ruleForm.giveGoldFlag
if (this.accountLevel == 4) {
param.packageImg = this.ruleForm.packageImg
param.sharePosterImg = this.ruleForm.sharePosterImg
}
}
let lists = this.choseItemList
......@@ -406,12 +436,13 @@ export default {
params.packagePrice = this.ruleForm.packagePrice
params.notes = this.ruleForm.notes
params.switchStatus = this.ruleForm.switchStatus ? 1 : 0
// 海马刀传参
if (this.isHmd) params.memberPayFlags = this.ruleForm.memberPayFlags
if (this.showGh) {
params.giveGoldFlag = this.ruleForm.giveGoldFlag
if (this.accountLevel == 4) {
params.packageImg = this.ruleForm.packageImg
params.sharePosterImg = this.ruleForm.sharePosterImg
}
}
let list = this.choseItemList
......
......@@ -402,7 +402,7 @@ export default {
this.$refs.proGroupRef.tableHeightValues = ''
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
if (item.specificationDetailList&&item.specificationDetailList.length > 1) {
let retailPriceList = JSON.parse(JSON.stringify(item.specificationDetailList))
retailPriceList.sort((a, b) => {
return a.retailPrice - b.retailPrice
......@@ -418,7 +418,7 @@ export default {
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
} else if (item.specificationDetailList&&item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
......
......@@ -523,7 +523,7 @@ export default {
this.$refs.proGroupRef.tableHeightValues = ''
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
if (item.specificationDetailList&&item.specificationDetailList.length > 1) {
let retailPriceList = JSON.parse(JSON.stringify(item.specificationDetailList))
retailPriceList.sort((a, b) => {
return a.retailPrice - b.retailPrice
......@@ -539,7 +539,7 @@ export default {
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
} else if (item.specificationDetailList&&item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
......
......@@ -86,10 +86,10 @@ export default {
handleRates() {
const {marketingCustomerCount, reachCustomerCount, potentialCustomerCount, dealCustomerCount} = this.list
this.rates.reachRate = parseFloat(((reachCustomerCount / marketingCustomerCount) * 100).toFixed(2))
this.rates.reachRate = !marketingCustomerCount ? '-' : parseFloat(((reachCustomerCount / marketingCustomerCount) * 100).toFixed(2))
this.rates.percentConversion
= parseFloat(((potentialCustomerCount / reachCustomerCount)*100).toFixed(2))
this.rates.turnoverRatio = parseFloat(((dealCustomerCount / potentialCustomerCount)*100).toFixed(2))
= !reachCustomerCount ? '-' : parseFloat(((potentialCustomerCount / reachCustomerCount) * 100).toFixed(2))
this.rates.turnoverRatio = !potentialCustomerCount ? '-' : parseFloat(((dealCustomerCount / potentialCustomerCount) * 100).toFixed(2))
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!