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