Commit 00b1e22b by 黑潮

Merge branch 'feature/修改集团会员卡等级' into master

parents acde959b 41972ac0
......@@ -20,9 +20,18 @@ export default {
this.baseUrl = window.location.origin.indexOf('localhost') > -1 ? 'http://gicdev.demogic.com' : window.location.origin;
this._getUserInfo();
this.changeTab();
this.isEditClique();
},
methods: {
isEditClique() {
this.axios.get(`${this.baseUrl}/api-member/allow-edit-clique-grade?requestProject=member`).then((res) => {
if (res.data.errorCode == 0) {
let showEditClique = res.data.result;
this.$store.commit('setEditClique', showEditClique);
}
});
},
laout() {
this.axios.get(`${this.baseUrl}/api-auth/do-logout?requestProject=member`);
},
......@@ -65,4 +74,4 @@ export default {
}
}
}
</script>
\ No newline at end of file
</script>
......@@ -2,6 +2,7 @@ const host = window.location.origin;
const baseUrl = host.indexOf('localhost') > -1 ? 'http://gicdev.demogic.com' : host;
const urlConfig = {
cliqueGradeList: '/api-admin/clique-grade-list',
doLogin: '/api-auth/dologin', // 登录
enterprise: '/api-auth/list-login-enterprise',//企业列表
clerkMenu: '/api-auth/login-clerk-menu',
......
......@@ -70,9 +70,11 @@ export default {
dialogGradeVisible: false,
gradeForm: {
gradeId: "",
remark: ""
remark: "",
isClique: 0
},
memberGrade: [],
cliqueMemberGrade: [],
graderules: {
gradeId: [{ required: true, message: "请选择等级", trigger: "change" }],
remark: [
......@@ -138,7 +140,16 @@ export default {
};
},
computed: {
...mapState(["storeImageUrl"])
showCardList() {
if (this.gradeForm.isClique == 0) {
return this.memberGrade;
} else if (this.gradeForm.isClique == 1) {
return this.cliqueMemberGrade;
} else {
return []
}
},
...mapState(["storeImageUrl", 'showEditClique'])
},
filters: {
formatTimeYMD(val) {
......@@ -242,7 +253,7 @@ export default {
}
if (tempVal == "highCost") {
returnVal = "最高单笔(应收)";
}
}
return returnVal;
},
formatFieldName: function(val) {
......@@ -625,6 +636,7 @@ export default {
return false;
}
doFetch(url.updateGrade, {
isClique: this.gradeForm.isClique,
memberIds: this.selectAll == true ? "-1" : memberIdsArr.join(","),
remark: this.gradeForm.remark,
gradeId: this.gradeForm.gradeId,
......@@ -664,7 +676,7 @@ export default {
doFetch(url.gradeList)
.then(res => {
if (res.data.errorCode === 0) {
this.memberGrade = res.data.result;
this.memberGrade = res.data.result || [];
} else {
checkFalse(res.data.message);
return false;
......@@ -674,6 +686,19 @@ export default {
checkStatus(err);
});
},
getCliqueGradeList() {
doFetch(url.cliqueGradeList).then(res => {
if (res.data.errorCode === 0) {
this.cliqueMemberGrade = res.data.result || [];
} else {
checkFalse(res.data.message);
return false;
}
})
.catch(err => {
checkStatus(err);
});
},
closeGrade(formName) {
if (this.$refs[formName]) {
this.$refs[formName].resetFields();
......@@ -832,7 +857,11 @@ export default {
return;
} else if (this.batchValue == "grade") {
this.dialogGradeVisible = true;
if (this.showEditClique) {
this.gradeForm.isClique = 1;
}
this.getGradeList();
this.getCliqueGradeList();
if (this.$refs.gradeForm) {
this.$refs.gradeForm.resetFields();
}
......
......@@ -434,7 +434,7 @@
<el-table-column
label="操作"
fixed="right"
>
>
<template slot-scope="scope">
<div class="operate">
<router-link
......@@ -597,6 +597,14 @@
label-width="120px"
>
<el-form-item
v-if="showEditClique"
label="等级类型"
prop="gradeType"
>
<el-radio v-model="gradeForm.isClique" :label="1" @change="gradeForm.gradeId = ''">集团等级</el-radio>
<el-radio v-model="gradeForm.isClique" :label="0" @change="gradeForm.gradeId = ''">商户等级</el-radio>
</el-form-item>
<el-form-item
label="调整后等级"
prop="gradeId"
>
......@@ -605,7 +613,7 @@
placeholder="请选择"
>
<el-option
v-for="item in memberGrade"
v-for="item in showCardList"
:key="item.id"
:label="item.name"
:value="item.id"
......
......@@ -32,7 +32,7 @@ export default {
sceneValue: "member",
tableData: [],
base: false,
pageName: "wxMember",
pageName: "wxMember",
page: {
currentPage: 1,
pageSize: 20,
......@@ -75,9 +75,11 @@ export default {
dilogGradeVisible: false,
gradeForm: {
gradeId: "",
remark: ""
remark: "",
isClique: 0
},
memberGrade: [],
cliqueMemberGrade: [],
graderules: {
gradeId: [{ required: true, message: "请选择等级", trigger: "change" }],
remark: [
......@@ -144,7 +146,16 @@ export default {
};
},
computed: {
...mapState(["storeImageUrl"])
showCardList() {
if (this.gradeForm.isClique == 0) {
return this.memberGrade;
} else if (this.gradeForm.isClique == 1) {
return this.cliqueMemberGrade;
} else {
return []
}
},
...mapState(["storeImageUrl", 'showEditClique'])
},
filters: {
formatField: function(val) {
......@@ -239,7 +250,7 @@ export default {
}
if (tempVal == "highCostPaid") {
returnVal = "最高单笔(实付)";
}
}
return returnVal;
},
formatFieldName: function(val) {
......@@ -648,6 +659,7 @@ export default {
return false;
}
doFetch(url.updateGrade, {
isClique: this.gradeForm.isClique,
memberIds: this.selectAll == true ? "-1" : memberIdsArr.join(","),
remark: this.gradeForm.remark,
gradeId: this.gradeForm.gradeId,
......@@ -684,7 +696,7 @@ export default {
doFetch(url.gradeList)
.then(res => {
if (res.data.errorCode === 0) {
this.memberGrade = res.data.result;
this.memberGrade = res.data.result || [];
} else {
checkFalse(res.data.message);
return false;
......@@ -694,6 +706,19 @@ export default {
checkStatus(err);
});
},
getCliqueGradeList() {
doFetch(url.cliqueGradeList).then(res => {
if (res.data.errorCode === 0) {
this.cliqueMemberGrade = res.data.result || [];
} else {
checkFalse(res.data.message);
return false;
}
})
.catch(err => {
checkStatus(err);
});
},
closeGrade(formName) {
if (this.$refs[formName]) {
this.$refs[formName].resetFields();
......@@ -855,6 +880,9 @@ export default {
return;
} else if (this.batchValue == "grade") {
this.dilogGradeVisible = true;
if (this.showEditClique) {
this.gradeForm.isClique = 1;
}
if (this.$refs.gradeForm) {
this.$refs.gradeForm.resetFields();
}
......@@ -1077,6 +1105,7 @@ export default {
this.initialize();
this.getAjaxMembers();
this.getGradeList();
this.getCliqueGradeList();
this.$on('hook:deactivated', _ => {
this.setLayoutTips(false);
if(this.timer) clearInterval(this.timer);
......
......@@ -233,7 +233,7 @@
<span v-else-if="item == 'costAll'">
{{ scope.row.costFee }}
</span>
<div v-else-if="item == 'costTimes'">
<div>{{ scope.row.costTimes | formatTimeYMD }}</div>
<div>{{ scope.row.costTimes | formatTimeHMS }}</div>
......@@ -604,6 +604,14 @@
label-width="120px"
>
<el-form-item
v-if="showEditClique"
label="等级类型"
prop="gradeType"
>
<el-radio v-model="gradeForm.isClique" :label="1" @change="gradeForm.gradeId = ''">集团等级</el-radio>
<el-radio v-model="gradeForm.isClique" :label="0" @change="gradeForm.gradeId = ''">商户等级</el-radio>
</el-form-item>
<el-form-item
label="调整后等级"
prop="gradeId"
>
......@@ -613,7 +621,7 @@
style="width: 400px;"
>
<el-option
v-for="item in memberGrade"
v-for="item in showCardList"
:key="item.id"
:label="item.name"
:value="item.id"
......
......@@ -220,7 +220,7 @@ export default {
};
},
computed: {
...mapState(["storeImageUrl"])
...mapState(["storeImageUrl", 'showEditClique'])
},
filters: {
limitText: val => {
......@@ -240,6 +240,38 @@ export default {
}
},
methods: {
getCliqueGradeList() {
doFetch(url.cliqueGradeList).then(res => {
if (res.data.errorCode === 0) {
this.memberGrade = res.data.result || [];
} else {
checkFalse(res.data.message);
return false;
}
})
.catch(err => {
checkStatus(err);
});
},
handlerCliqueGrade() {
if(this.memberInfo.erpCalcGrade) {
this.$confirm('因为等级由ERP计算,请前往ipos或ERP进行修改,避免等级同步不一致', '提示', {
confirmButtonText: '继续修改',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCliqueGradeList();
this.gradeForm.isClique = 1;
this.gradeForm.gradeId = this.memberInfo.cliqueGradeId;
this.dilogGradeVisible = true;
})
} else {
this.getCliqueGradeList();
this.gradeForm.isClique = 1;
this.gradeForm.gradeId = this.memberInfo.cliqueGradeId;
this.dilogGradeVisible = true;
}
},
// 修改主门店(修改服务门店)
handleUpdateMainStore() {
if (!this.updateMainStore.mainStoreId) {
......@@ -356,7 +388,7 @@ export default {
});
for(let i = 0; i < item.checkBox.length; i++) {
let val = item.checkBox[i];
for (let j = 0; j < item.subTags.length; j++) {
if (val == item.subTags[j].tagsName) {
item.subTags[j].isCheck = 1;
......@@ -688,6 +720,7 @@ export default {
this.$refs[formName].validate(valid => {
if (valid) {
doFetch(url.memberGrade, {
isClique: this.gradeForm.isClique,
memberId: this.memberInfo.memberId,
remark: this.gradeForm.remark,
gradeId: this.gradeForm.gradeId
......
......@@ -133,8 +133,9 @@
<span>商户会员等级</span><span class="ml15 color555">{{ memberInfo.gradeName | fomatText }}</span>
<span class="ml15" @click="handlerGrade"><i class="el-icon-edit pointer"></i></span>
</div>
<div class="wechat-carditem" v-if="showClique">
<div class="wechat-carditem" style="white-space: nowrap" v-if="showClique">
<span>集团会员等级</span><span class="ml15 color555">{{ memberInfo.cliqueGradeName | fomatText }}</span>
<span class="ml15" v-if="showEditClique" @click="handlerCliqueGrade"><i class="el-icon-edit pointer"></i></span>
</div>
<div class="wechat-carditem" v-if="showClique">
......@@ -278,7 +279,7 @@
<span class="member-tag-item" v-show="memberGradeGroup.groupName">{{ memberGradeGroup.groupName}}</span>
</div>
<div class="member-tag-list" v-if="memberTagGroupList.length">
<span class="member-tag-title">会员分组: </span>
<span class="member-tag-title">会员分组: </span>
<span class="member-tag-item" v-for="(item, index) in memberTagGroupList" :key="index">{{ item.groupName }}</span>
</div>
</div>
......@@ -783,7 +784,7 @@ export default { ...wechatTotalDetail }
// background rgba(3,3,3,.5)
// &:hover .wechat-refresh
// transform rotate(180deg)
.maskOperation
.maskOperation
position absolute
left 0
right 0
......@@ -1046,7 +1047,7 @@ export default { ...wechatTotalDetail }
text-align: right;
}
.fontRed {
color: red;
color: red;
}
.tag-item
......
......@@ -76,9 +76,11 @@ export default {
dilogGradeVisible: false,
gradeForm: {
gradeId: "",
remark: ""
remark: "",
isClique: 0
},
memberGrade: [],
cliqueMemberGrade: [],
graderules: {
gradeId: [{ required: true, message: "请选择等级", trigger: "change" }],
remark: [
......@@ -145,7 +147,16 @@ export default {
};
},
computed: {
...mapState(["storeImageUrl"])
showCardList() {
if (this.gradeForm.isClique == 0) {
return this.memberGrade;
} else if (this.gradeForm.isClique == 1) {
return this.cliqueMemberGrade;
} else {
return []
}
},
...mapState(["storeImageUrl", 'showEditClique'])
},
filters: {
formatField: function(val) {
......@@ -556,6 +567,7 @@ export default {
return false;
}
doFetch(url.updateGrade, {
isClique: this.gradeForm.isClique,
memberIds: this.selectAll == true ? "-1" : memberIdsArr.join(","),
remark: this.gradeForm.remark,
gradeId: this.gradeForm.gradeId,
......@@ -592,7 +604,7 @@ export default {
doFetch(url.gradeList)
.then(res => {
if (res.data.errorCode === 0) {
this.memberGrade = res.data.result;
this.memberGrade = res.data.result || [];
} else {
checkFalse(res.data.message);
return false;
......@@ -602,6 +614,19 @@ export default {
checkStatus(err);
});
},
getCliqueGradeList() {
doFetch(url.cliqueGradeList).then(res => {
if (res.data.errorCode === 0) {
this.cliqueMemberGrade = res.data.result || [];
} else {
checkFalse(res.data.message);
return false;
}
})
.catch(err => {
checkStatus(err);
});
},
closeGrade(formName) {
if (this.$refs[formName]) {
this.$refs[formName].resetFields();
......@@ -761,6 +786,9 @@ export default {
return;
} else if (this.batchValue == "grade") {
this.dilogGradeVisible = true;
if (this.showEditClique) {
this.gradeForm.isClique = 1;
}
if (this.$refs.gradeForm) {
this.$refs.gradeForm.resetFields();
}
......@@ -977,7 +1005,7 @@ export default {
promiseAll() {
// http://gicdev.demogic.com/api-member/find-member-fields?requestProject=member
// http://gicdev.demogic.com/api-member/enterprise-info?requestProject=member
let urls = [
'http://gicdev.demogic.com/api-member/find-member-fields?requestProject=member',
'http://gicdev.demogic.com/api-member/enterprise-info?requestProject=member'
......@@ -1010,6 +1038,7 @@ export default {
this.initialize();
this.getAjaxMembers();
this.getGradeList();
this.getCliqueGradeList();
this.setLayoutTips();
this.$on('hook:deactivated', _ => {
this.setLayoutTips(false);
......
......@@ -539,7 +539,7 @@
:max="999999"
></el-input-number>
</el-form-item>
<el-form-item
label="原因备注"
prop="remark"
......@@ -602,6 +602,14 @@
label-width="120px"
>
<el-form-item
v-if="showEditClique"
label="等级类型"
prop="gradeType"
>
<el-radio v-model="gradeForm.isClique" :label="1" @change="gradeForm.gradeId = ''">集团等级</el-radio>
<el-radio v-model="gradeForm.isClique" :label="0" @change="gradeForm.gradeId = ''">商户等级</el-radio>
</el-form-item>
<el-form-item
label="调整后等级"
prop="gradeId"
>
......@@ -611,7 +619,7 @@
style="width: 400px;"
>
<el-option
v-for="item in memberGrade"
v-for="item in showCardList"
:key="item.id"
:label="item.name"
:value="item.id"
......
......@@ -7,6 +7,7 @@ import { doFetch } from "../components/axios/api";
Vue.use(Vuex);
export default new Vuex.Store({
state: {
showEditClique: false,
title: "",
isShowFoot: true,
slideShow: false,
......@@ -42,6 +43,9 @@ export default new Vuex.Store({
mutations_layoutTips(state, val) {
state.layoutTips = val;
},
['setEditClique'](state, val) {
state.showEditClique = val;
}
},
actions: {
getStorePicture({ commit }) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment