Commit badb0566 by 王志慧

广汇需求开发

1 parent 5c7adb19
......@@ -78,6 +78,17 @@ const getCardtypeList = params => {
returnAll: true
})
}
// 重置会员权益卡
const resetCard = params => {
params.method ='scrm.api.equity.card.reset'
return http({
url: '/rop-scrm-equity/router',
method: 'POST',
data: params,
returnAll: true
})
}
export { getCenterListApi, getMoreMerchant, updateCardContent, getCardContent, memberExportApi, getQrUrl ,getCardtypeList}
export {resetCard, getCenterListApi, getMoreMerchant, updateCardContent, getCardContent, memberExportApi, getQrUrl ,getCardtypeList}
<template>
<div class="marketing live-room">
<div class="memberCardWrap" v-if="!(merchantModel == 2 && accountLevel == 1)">
<div class="memberCardWrap" v-if="showGh||!(merchantModel == 2 && accountLevel == 1)">
<div class="cardBoxWrap">
<img src="@/assets/memberCard.png" alt="" />
<div class="memberCardName">{{ ruleForm.cardName }}</div>
......@@ -16,7 +16,9 @@
<template v-if="showGh">
<div class="member-card"><img src="@/assets/silver.png" alt="" /></div>
</template>
<GLButton @click="openEditWrap" fn="编辑" mode="div"><img src="@/assets/editBlue.png" class="editIcon" @click="openEditWrap" alt="" /></GLButton>
<template>
<GLButton @click="openEditWrap" fn="编辑" mode="div"><img src="@/assets/editBlue.png" class="editIcon" @click="openEditWrap" alt="" /></GLButton>
</template>
</div>
<template v-if="showGh">
<div class="flex-1 mt-10 line-20">
......@@ -26,7 +28,6 @@
<div class="member-card"><img src="@/assets/gold.png" alt="" /></div>
</div>
</template>
<div class="row">
<span>售价:</span>
<span class="price text-e8" v-if="ruleForm.price">¥{{ ruleForm.price }}</span>
......@@ -58,15 +59,14 @@
<el-input v-model.trim="ruleForm.goldCardClassName" size="small" class="cardNameInput" show-word-limit placeholder="请输入金卡名称" maxlength="15"></el-input>
</el-form-item>
</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)">
<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-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)">
<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-form-item>
......@@ -84,7 +84,6 @@
<!-- <div v-if="ruleForm.tryAble" class="promoteQR">生成小程序码推广</div> -->
</el-form-item>
</el-form>
<div style="display: flex">
<el-button size="small" class="cancelBtn" @click="cancelEdit">取消</el-button>
<el-button size="small" class="saveBtn" type="primary" @click="submitRuleForm('ruleForm')">保存</el-button>
......@@ -99,7 +98,6 @@
<div class="text-16 color-3 weight-5">会员列表</div>
<div class="export" @click="handleExport">全部导出</div>
</div>
<GLTable ref="memberCenterRef" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div slot="cardInfo" slot-scope="scope">
<GLTable class="centerTable" ref="cardListRef" :hasNum="false" :hasPage="false" :noDataImg="url" :tableParams="cardParams" :tableData="scope.scope.list"></GLTable>
......@@ -108,6 +106,9 @@
<div>{{ scope.scope.accountName }}</div>
<div>{{ scope.scope.mobile }}</div>
</span>
<span slot="optionBtns" slot-scope="scope" v-if="scope.scope.goldMemberStatus == 1">
<span class="txt-blue pointer" @click="chancelMember(scope.scope)">取消会员</span>
</span>
</GLTable>
</div>
<GLDialog :mode="mode" title="权益详情" :hasFooter="hasFooter" :type="'error'" :visible.sync="isDialogVisible">
......@@ -151,7 +152,6 @@
</GLDialog>
</div>
</template>
<script>
const cloneText = message => {
let input = document.createElement('input')
......@@ -161,7 +161,7 @@ const cloneText = message => {
input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input)
}
import { getCenterListApi, getMoreMerchant, getCardContent, updateCardContent, memberExportApi, getQrUrl, getCardtypeList } from '@/api/modules/center'
import { getCenterListApi, getMoreMerchant, getCardContent, updateCardContent, memberExportApi, getQrUrl, getCardtypeList, resetCard } from '@/api/modules/center'
import { statusList, memberTypeList, exportFn } from '@/common/constant'
export default {
filters: {
......@@ -257,7 +257,6 @@ export default {
{
label: '会员用户',
prop: 'accountName',
width: '180',
addHtml: 'accountName'
},
{
......@@ -335,9 +334,7 @@ export default {
}
]
},
isShowEditWrap: false,
ruleForm: {
equityId: '',
cardName: '',
......@@ -371,6 +368,7 @@ export default {
this.accountLevel = this.$globalState.session.accountLevel
}
this.showGh = window.location.host.indexOf('cgacar') != -1
if (this.showGh) this.judgeGh()
this.getCardContentFun()
this.getCardtypeList()
},
......@@ -378,6 +376,40 @@ export default {
this.getOptionsList('searchFormData')
},
methods: {
judgeGh() {
if (this.accountLevel == 4) {
this.baseData.openModeList.push({
dictValue: 13,
dictLabel: '通过门店套餐赠送'
})
}
this.tableParams.tableColumns.push({
label: '操作',
width: '140px',
addHtml: 'optionBtns'
})
},
chancelMember(data) {
this.$messageBox.confirm('此操作会将该会员用户的剩余会员有效天数扣减1年或归0,是否确认继续操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
// type: 'error',
callback: action => {
if (action == 'confirm') {
resetCard({ mobile: data.mobile }).then(res => {
this.$message({
message: res.code == '0' ? '将该用户的会员有效天数扣减365天,不足365天则直接将会员身份变更为普通会员' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
......@@ -403,7 +435,6 @@ export default {
})
}
},
//门店会员开通方式
getCardtypeList() {
getCardtypeList({}).then(res => {
......@@ -576,7 +607,6 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.centerTable {
padding-left: 10px;
......@@ -628,9 +658,9 @@ export default {
.memberCardWrap {
display: flex;
background-color: #fff;
height: 190px;
height: auto;
box-sizing: border-box;
padding: 10px 8px;
padding: 20px 8px;
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.1);
.cardBoxWrap {
position: relative;
......@@ -733,7 +763,6 @@ export default {
}
}
}
.pageTitle {
position: relative;
padding: 15px 20px;
......@@ -758,7 +787,6 @@ export default {
box-sizing: border-box;
cursor: pointer;
}
.el-form-item {
margin-bottom: 15px;
}
......@@ -825,7 +853,6 @@ export default {
overflow: hidden;
}
}
.pricesMerge {
display: flex;
width: 1500px;
......@@ -888,4 +915,4 @@ export default {
cursor: pointer;
}
}
</style>
</style>
\ No newline at end of file
......@@ -72,7 +72,7 @@
<div class="dialog-refund">
<img class="img" src="../../images/warn.png" />
<div>该会员在升级黑卡会员期间,已购买过生活权益</div>
<div style="color: #FF4D4F;padding: 6px 0;">(时间:{{ orderDate }} 金额:{{ orderPrice }}元)</div>
<div style="color: #ff4d4f; padding: 6px 0">(时间:{{ orderDate }} 金额:{{ orderPrice }}元)</div>
<div>暂不支持退款</div>
</div>
</GLDialog>
......@@ -84,7 +84,6 @@
</GLDialog>
</div>
</template>
<script>
import { orderTypesList, orderStatusList, exportFn } from '@/common/constant'
import url from '@/assets/empty.png'
......@@ -102,6 +101,7 @@ export default {
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
url: url,
isReload: true,
showGh: false,
size: 'small',
searchForm: {
orderStatus: '', //默认查询全部
......@@ -157,7 +157,7 @@ export default {
name: 'shareStaffName',
type: 'input',
maxlength: 100
},
}
],
choseList: ['全部', '待收货', '已完成', '退款|售后'],
currentIndex: 1,
......@@ -290,6 +290,8 @@ export default {
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
}
this.showGh = window.location.host.indexOf('cgacar') != -1
if(this.showGh) this.judgeGh()
// if (this.$isGroupUp) {
// let idx = this.tableParams.tableColumns.findIndex(item => item.label == '推荐人')
// this.tableParams.tableColumns.splice(idx, 1)
......@@ -299,6 +301,41 @@ export default {
this.getOptionsList('searchFormData')
},
methods: {
judgeGh() {
this.searchFormData.push({
label: '收款商户',
name: 'payMerchantName',
type: 'input',
maxlength: 100
},
{
label: '车牌号',
name: 'plateNum',
type: 'input',
maxlength: 100
},
{
label: '车架号',
name: 'standNo',
type: 'input',
maxlength: 100
})
this.tableParams.tableColumns.push({
label: '收款商户',
width: '140px',
prop: 'payMerchantName'
},
{
label: '车牌号',
width: '140px',
prop: 'plateNum'
},
{
label: '车架号',
width: '140px',
prop: 'standNo'
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
......@@ -324,7 +361,6 @@ export default {
})
}
},
tabClick(index) {
this.currentIndex = index
switch (index) {
......@@ -355,7 +391,6 @@ export default {
}
this.handleSearch()
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
......@@ -365,7 +400,6 @@ export default {
delete params.daterange
return params
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = this.getParams()
......@@ -425,14 +459,12 @@ export default {
}
})
},
handleExport(row) {
var params = this.getParams()
orderExportApi(params).then(res => {
exportFn(res)
})
},
handleSearch() {
this.$refs.memberOrderRef.refreshTable()
},
......@@ -468,7 +500,6 @@ export default {
}
}
</script>
<style lang="scss" scoped>
// /deep/.el-input--small .el-input__inner {
// width: 215px;
......@@ -476,7 +507,6 @@ export default {
.el-range-editor.is-active,
.el-range-editor.is-active:hover {
border-color: #5850ff;
width: 215px;
}
.el-range-editor--small.el-input__inner {
......@@ -544,4 +574,4 @@ export default {
// text-align: center;
// }
}
</style>
</style>
\ No newline at end of file
......@@ -29,7 +29,13 @@
</div>
<div class="el-form-item__error" v-if="setmealContentRules">请选择套餐</div>
</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>
<el-radio :label="1">不赠送</el-radio>
</el-radio-group>
</el-form-item>
<span class="give-tip">选择赠送,客户购买该套餐后即开通一年金卡会员权益</span>
<el-form-item size="small" label="套餐售价/元:" prop="packagePrice">
<el-input size="small" v-model="ruleForm.packagePrice" placeholder="请输入套餐售价" @keyup.native="ruleForm.packagePrice = oninput(ruleForm.packagePrice)">
<!-- <span slot="suffix" class="suffix-label">元</span> -->
......@@ -73,7 +79,6 @@
<select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedMealList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog>
</div>
</template>
<script>
import { getSetmealService, createSetMeal, getServiceInfo, updateSetMeal, configSetMeal } from '@/api/modules/setmeal'
import { getCardContent } from '@/api/modules/center'
......@@ -86,8 +91,8 @@ export default {
var validatePrice = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入售价'))
} else if (value < this.memberPrice && this.accountLevel !== 4 && this.showGh) {
return callback(new Error('套餐售价需大于会员卡的售价'))
} else if (value < this.memberPrice && this.ruleForm.giveGoldFlag == 2 &&this.accountLevel==4&& this.showGh) {
return callback(new Error('套餐售价不能低于会员卡价格'))
} else {
callback()
}
......@@ -100,12 +105,14 @@ export default {
packagePrice: '',
switchStatus: true,
// couponList:[],
notes: ''
notes: '',
giveGoldFlag: ''
},
copyRuleForm: {}, //用于检查页面信息是否改动
rules: {
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' }]
},
allItemList: [],
choseItemList: [], //['一年12次洗车券×1', '车身打蜡×2', '全车镀膜×1'],
......@@ -186,27 +193,27 @@ export default {
this.merchantName = this.$globalState.session.merchantName
this.accountLevel = this.$globalState.session.accountLevel
}
let href = window.location.host
this.showGh = href.indexOf('cgacar') != -1
this.showGh = window.location.host.indexOf('cgacar')!= -1
if (this.showGh) {
this.getCardContentFun()
}
this.getServiceInfo()
if (this.id) {
this.getServiceInfo()
} else {
this.ruleForm.giveGoldFlag = 2
}
// this.getSetmealServiceFun() //获取服务套餐,执行完了之后去获取编辑详情
},
mounted() { },
mounted() {},
methods: {
//获取会员卡上方卡片的相关信息
getCardContentFun() {
if (this.accountLevel !== 4) {
getCardContent({ merchantId: this.merchantId }).then(res => {
if (!res) {
return
}
this.memberPrice = res.goodPrice
})
}
getCardContent({ merchantId: this.merchantId }).then(res => {
if (!res) {
return
}
this.memberPrice = res.goodPrice
})
},
// 礼包
recoveryGiftList() {
......@@ -216,6 +223,11 @@ export default {
this.choseItemList.push(k)
})
})
if (this.choseItemList.length> 0) {
this.setmealContentRules = false
}else{
this.setmealContentRules = true
}
},
handleGiftDelete(attr, idx) {
this.couponObj[attr].list.splice(idx, 1)
......@@ -267,7 +279,6 @@ export default {
item.couponAmount = item.serviceQuantity
item.id = item.serviceId
})
this.recoveryCoupon()
this.copyTotalPrice = this.totalPrice
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
......@@ -303,11 +314,6 @@ export default {
}
return
}
if (this.choseItemList.length <= 0) {
this.setmealContentRules = true
return
}
if (this.id) {
//需要调config的接口????
// scrm.api.equity.package.service.config
......@@ -322,6 +328,7 @@ export default {
param.packagePrice = this.ruleForm.packagePrice
param.notes = this.ruleForm.notes
param.switchStatus = this.ruleForm.switchStatus ? 1 : 0
if (this.showGh) param.giveGoldFlag = this.ruleForm.giveGoldFlag
let lists = this.choseItemList
for (var k in lists) {
param[`lists[${k}].serviceQuantity`] = lists[k].couponAmount
......@@ -357,6 +364,7 @@ export default {
params.packagePrice = this.ruleForm.packagePrice
params.notes = this.ruleForm.notes
params.switchStatus = this.ruleForm.switchStatus ? 1 : 0
if (this.showGh) params.giveGoldFlag = this.ruleForm.giveGoldFlag
let list = this.choseItemList
for (var i in list) {
params[`list[${i}].serviceQuantity`] = list[i].couponAmount
......@@ -405,7 +413,6 @@ export default {
})
})
},
goBack() {
// this.$router.go(-1)
if (JSON.stringify(this.ruleForm) == JSON.stringify(this.copyRuleForm) && this.choseItemList.length == this.copyChoseItemList.length && this.totalPrice == this.copyTotalPrice) {
......@@ -455,7 +462,6 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.live-room {
/deep/ .el-icon-warning {
......@@ -497,13 +503,11 @@ export default {
padding-top: 5px;
padding-left: 10px;
box-sizing: border-box;
.choseItem {
position: relative;
min-width: 90px;
padding: 0 22px 0 6px;
box-sizing: border-box;
height: 26px;
line-height: 22px;
// background: #e6e9ff;
......@@ -548,7 +552,6 @@ export default {
margin-bottom: -5px;
span {
font-size: 14px;
font-weight: 400;
color: #666666;
}
......@@ -677,5 +680,15 @@ export default {
margin-left: -110px;
}
}
.give-tip {
font-weight: 400;
font-size: 12px;
color: #999999;
display: block;
margin: -15px 0 20px 154px;
}
}
/deep/ .el-form-item__error {
margin-left: 154px;
}
</style>
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!