init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
469
Public/Retail/js/vip/common-operate.js
可执行文件
469
Public/Retail/js/vip/common-operate.js
可执行文件
@@ -0,0 +1,469 @@
|
||||
//此文件使用了select-store组件
|
||||
//必须在同页面引入/Public/Retail/common/js/select-store.js
|
||||
|
||||
//冻结会员
|
||||
Vue.component('vip-frozen', {
|
||||
template: `<el-button @click.native="frozenVip" type="text" size="mini">冻结</el-button>`,
|
||||
props: {
|
||||
'vid': {
|
||||
type: String,
|
||||
default: '',
|
||||
},//会员ID
|
||||
'type': {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},//提交的来源类型 1商户普通会员 2商户plus会员 3门店普通会员 4门店plus会员
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
submitUrl: {
|
||||
1: 'Retail/Vip/frozenVip',
|
||||
2: 'Retail/Plus/frozenVip',
|
||||
3: 'Retail/Vips/frozenVip',
|
||||
4: 'Retail/Plus/storeFrozenVip',
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
frozenVip() {
|
||||
this.$confirm('确定冻结该会员?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.sendRequest(this.submitUrl[this.type], {
|
||||
data: {
|
||||
vip_id: this.vid
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.$message.success(res.message);
|
||||
this.$emit('end');
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
//挂失会员
|
||||
Vue.component('vip-loss', {
|
||||
template: `<el-button @click.native="lossVip" type="text" size="mini">挂失</el-button>`,
|
||||
props: {
|
||||
'vid': {
|
||||
type: String,
|
||||
default: '',
|
||||
},//会员ID
|
||||
'type': {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},//提交的来源类型 1商户普通会员 2商户plus会员 3门店普通会员 4门店plus会员
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
submitUrl: {
|
||||
1: 'Retail/Vip/lossVip',
|
||||
2: 'Retail/Plus/lossVip',
|
||||
3: 'Retail/Vips/lossVip',
|
||||
4: 'Retail/Plus/storeLossVip',
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
lossVip() {
|
||||
this.$confirm('确定挂失该会员?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.sendRequest(this.submitUrl[this.type], {
|
||||
data: {
|
||||
vip_id: this.vid
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.$message.success(res.message);
|
||||
this.$emit('end');
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
//恢复会员
|
||||
Vue.component('vip-thaw', {
|
||||
template: `<el-button @click.native="thawVip" type="text" size="mini">恢复</el-button>`,
|
||||
props: {
|
||||
'vid': {
|
||||
type: String,
|
||||
default: '',
|
||||
},//会员ID
|
||||
'type': {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},//提交的来源类型 1商户普通会员 2商户plus会员 3门店普通会员 4门店plus会员
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
submitUrl: {
|
||||
1: 'Retail/Vip/thawVip',
|
||||
2: 'Retail/Plus/thawVip',
|
||||
3: 'Retail/Vips/thawVip',
|
||||
4: 'Retail/Plus/storeThawVip',
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
thawVip() {
|
||||
this.$confirm('确定恢复该会员为正常会员?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.sendRequest(this.submitUrl[this.type], {
|
||||
data: {
|
||||
vip_id: this.vid
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.$message.success(res.message);
|
||||
this.$emit('end');
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
//修改支付密码
|
||||
Vue.component('vip-password', {
|
||||
template: `<el-button @click.native="modifyPassword" type="text" size="mini">支付密码</el-button>`,
|
||||
props: {
|
||||
'vid': {
|
||||
type: String,
|
||||
default: '',
|
||||
},//会员ID
|
||||
'type': {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},//提交的来源类型 1商户普通会员 2商户plus会员 3门店普通会员 4门店plus会员
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
submitUrl: {
|
||||
1: 'Retail/Vip/modifyPassword',
|
||||
2: 'Retail/Plus/modifyPassword',
|
||||
3: 'Retail/Vips/modifyPassword',
|
||||
4: 'Retail/Plus/storeModifyPassword',
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
modifyPassword() {
|
||||
this.$prompt('请输入6位数字的支付密码', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputPattern: /^[0123456789]{6}/,
|
||||
inputErrorMessage: '支付密码格式不正确'
|
||||
}).then(({value}) => {
|
||||
this.$loading({
|
||||
lock: true,
|
||||
text: '保存中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(255, 255, 255, 0.3)'
|
||||
});
|
||||
this.sendRequest(this.submitUrl[this.type], {
|
||||
data: {
|
||||
vip_id: this.vid,
|
||||
password: value
|
||||
},
|
||||
success: (res) => {
|
||||
this.$loading().close();
|
||||
if (res.status == 1) {
|
||||
this.$message.success(res.message);
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
},
|
||||
})
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
//编辑会员资料
|
||||
Vue.component('edit-vip-info', {
|
||||
template: `<el-dialog title="编辑会员信息" :append-to-body="true"
|
||||
:visible.sync="show"
|
||||
width="600px"
|
||||
:before-close="closeDialog"
|
||||
:close-on-click-modal="false">
|
||||
<el-form label-width="100px" size="small" ref="editForm" :rules="rules" :model="editForm">
|
||||
<el-form-item label="类型" prop="vip_type" v-if="editData.plus_type==3">
|
||||
<el-select size="small" v-model="editForm.vip_type" :disabled="editData.plus_type==2?true:false">
|
||||
<el-option label="常规会员" :value="1"></el-option>
|
||||
<el-option label="PLUS会员" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="PLUS时长" prop="operate_days_type" v-if="editData.plus_type==2">
|
||||
<el-radio-group size="mini" v-model="editForm.operate_days_type">
|
||||
<el-radio border :label="0">不变动</el-radio>
|
||||
<el-radio border :label="1">增加时长</el-radio>
|
||||
<el-radio border :label="2">减少时长</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="时长(天)" prop="operate_days"
|
||||
v-if="editData.plus_type==3&&editForm.vip_type==2||editForm.operate_days_type!=0">
|
||||
<el-input-number v-model="editForm.operate_days"
|
||||
style="width: 192px;"
|
||||
placeholder="PLUS有效天数" step-strictly
|
||||
:precision="0" :step="1"
|
||||
:max="10000000000" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="等级" v-if="editData.plus_type==3 && editForm.vip_type==1" prop="grade_id">
|
||||
<select-vip-grade :grade-id.sync="editForm.grade_id"
|
||||
:show-discount="true"
|
||||
:placeholder="'请选择会员等级'"></select-vip-grade>
|
||||
<span style="font-size: 12px;color: #8492A6;">不选择则重置会员等级</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="vip_name">
|
||||
<el-input v-model="editForm.vip_name"
|
||||
style="width: 192px;"
|
||||
placeholder="请输入会员姓名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属门店" v-if="type == 1 || type == 2">
|
||||
<select-store :store-id.sync="editForm.storeId"
|
||||
:store-status="3"
|
||||
:show-status="true"
|
||||
:placeholder="'会员所属门店'">
|
||||
</select-store>
|
||||
</el-form-item>
|
||||
<el-form-item label="余额" prop="balance">
|
||||
<el-input-number v-model="editForm.balance"
|
||||
style="width: 192px;" step-strictly
|
||||
placeholder="会员余额"
|
||||
:precision="2" :step="0.01"
|
||||
:max="1000000000" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="积分" prop="integral">
|
||||
<el-input-number v-model="editForm.integral"
|
||||
style="width: 192px;"
|
||||
placeholder="会员积分" step-strictly
|
||||
:precision="0" :step="1"
|
||||
:max="10000000000" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="mobile_phone">
|
||||
<el-input v-model="editForm.mobile_phone"
|
||||
style="width: 192px;" clearable
|
||||
placeholder="请输入会员手机号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="text-align: center">
|
||||
<el-button type="primary" size="medium" :loading="submitLoading" @click="submitEdit">提交</el-button>
|
||||
</div>
|
||||
</el-dialog>`,
|
||||
props: {
|
||||
'show': {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
'editData': {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
},//编辑会员的资料
|
||||
'type': {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},//提交的来源类型 1商户普通会员 2商户plus会员 3门店普通会员 4门店plus会员
|
||||
},
|
||||
data() {
|
||||
let _t = this;
|
||||
return {
|
||||
editForm: {
|
||||
vip_id: '',
|
||||
vip_type: 1,
|
||||
vip_name: '',
|
||||
grade_id: '',
|
||||
balance: '',
|
||||
integral: '',
|
||||
mobile_phone: '',
|
||||
operate_days_type: 0,
|
||||
operate_days: '',
|
||||
},
|
||||
rules: {
|
||||
vip_type: [{required: true, message: '请选择会员类型', trigger: 'change'}],
|
||||
operate_days_type: [{required: true, message: '请选择是否操作PLUS会员时长', trigger: 'change'}],
|
||||
operate_days: [{required: true, message: '请输入PLUS时长', trigger: 'change'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^-?([0-9]\d*|[0]{1})$/;
|
||||
if (_t.editForm.operate_days_type != 0) {
|
||||
if (value === '' || value === null || value == undefined) {
|
||||
callback(new Error("请输入PLUS时长"));
|
||||
} else if (reg.test(value) == false) {
|
||||
callback(new Error("请输入正确的PLUS时长"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
vip_name: [{required: true, message: '请输入会员姓名', trigger: 'change'}],
|
||||
grade_id: [{required: false, message: '请选择会员等级', trigger: 'change'}],
|
||||
balance: [{required: true, message: '请输入会员余额', trigger: 'change'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d{0,2})$/;
|
||||
if (value === '' || value === null || value == undefined) {
|
||||
callback(new Error("请输入会员余额"));
|
||||
} else if (reg.test(value) == false) {
|
||||
callback(new Error("请输入正确的会员余额"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
integral: [{required: true, message: '请输入会员积分', trigger: 'change'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^-?([0-9]\d*|[0]{1})$/;
|
||||
if (value === '' || value === null || value == undefined) {
|
||||
callback(new Error("请输入会员积分1"));
|
||||
} else if (reg.test(value) == false) {
|
||||
callback(new Error("请输入正确的会员积分"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
mobile_phone: [{required: true, message: '请输入会员手机号', trigger: 'change'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
if (value == '') {
|
||||
callback(new Error("请输入会员手机号"));
|
||||
} else if (!(/^[1][3456789][0-9]{9}$/).test(value)) {
|
||||
callback(new Error("请输入正确的会员手机号"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
},//编辑会员的资料的验证规则
|
||||
submitLoading: false,//提交的loading,
|
||||
submitUrl: {
|
||||
1: 'Retail/Vip/modifyVip',
|
||||
2: 'Retail/Plus/modifyVipInfo',
|
||||
3: 'Retail/Vips/modifyVip',
|
||||
4: 'Retail/Plus/storeModifyVipInfo',
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
closeDialog() {
|
||||
this.$refs.editForm.resetFields();
|
||||
this.$emit('end');
|
||||
},
|
||||
//修改会员信息
|
||||
submitEdit() {
|
||||
this.$refs.editForm.validate((valid) => {
|
||||
if (!valid) {
|
||||
return this.$message.warning('请检查表单信息');
|
||||
}
|
||||
this.$confirm('确认修改会员信息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info'
|
||||
}).then(() => {
|
||||
this.submitLoading = true;
|
||||
this.sendRequest(this.submitUrl[this.type], {
|
||||
data: {
|
||||
vip_edit_info: JSON.stringify(this.editForm),
|
||||
},
|
||||
success: (res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.status == 1) {
|
||||
this.$message.success(res.message);
|
||||
this.closeDialog();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
show(n) {
|
||||
if (n) {
|
||||
this.editForm = {
|
||||
vip_id: this.editData.id,
|
||||
vip_type: this.editData.plus_type == 2 ? '' : 1,
|
||||
vip_name: this.editData.name,
|
||||
grade_id: this.editData.grade_id,
|
||||
balance: this.editData.balance,
|
||||
integral: this.editData.integral,
|
||||
mobile_phone: this.editData.mobile_phone,
|
||||
operate_days_type: 0,
|
||||
operate_days: '',
|
||||
}
|
||||
|
||||
//在上面Data中没有设置storeId的初始化数据是因为门店不需要这个字段,在门店不允许修改所属门店
|
||||
if ([1, 2].includes(this.type)) this.editForm.storeId = this.editData.storeid
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//其他搜索
|
||||
Vue.component('vip-more-search', {
|
||||
template: `<div>
|
||||
<el-select style="width:164px;margin-right: 20px"
|
||||
v-model="section.type" placeholder="区间、类型"
|
||||
clearable>
|
||||
<el-option label="激活时间" value="1"></el-option>
|
||||
<el-option label="生日时间" value="2"></el-option>
|
||||
<el-option label="沉睡时间" value="3"></el-option>
|
||||
<el-option label="复购次数" value="4"></el-option>
|
||||
</el-select>
|
||||
|
||||
<date-picker-range v-if="section.type" :date-time.sync="section.time"></date-picker-range>
|
||||
|
||||
<el-input style="width:164px;margin-right: 20px" v-if="section.type == 4"
|
||||
v-model="section.purchase" placeholder="复购次数" clearable></el-input>
|
||||
<el-input style="width:164px;margin-right: 20px" v-model="section.integral"
|
||||
placeholder="积分区间(例:1-100)" clearable></el-input>
|
||||
<el-input style="width:164px;margin-right: 20px" v-model="section.balance"
|
||||
placeholder="余额区间(例:1-100)" clearable></el-input>
|
||||
</div>`,
|
||||
props: {
|
||||
'section': {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
integral: '',
|
||||
balance: '',
|
||||
purchase: '',
|
||||
type: '',
|
||||
time: '',
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
178
Public/Retail/js/vip/edit-vip-label.js
可执行文件
178
Public/Retail/js/vip/edit-vip-label.js
可执行文件
@@ -0,0 +1,178 @@
|
||||
//编辑会员资料
|
||||
Vue.component('edit-vip-label', {
|
||||
template: `<el-dialog title="修改标签" :modal-append-to-body="false"
|
||||
:visible.sync="show"
|
||||
width="600px"
|
||||
:before-close="closeDialog"
|
||||
:close-on-click-modal="false">
|
||||
<el-select v-model="choose_tag.name"
|
||||
placeholder="请选择标签"
|
||||
v-load-more="getTagList"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
:disabled="vipTags.length>=20?true:false"
|
||||
:remote-method="searchTag"
|
||||
@change="chooseTag"
|
||||
size="small">
|
||||
<el-option v-for="(item,index) in tagList"
|
||||
:disabled="verifyTag(item.id)"
|
||||
:label="item.name"
|
||||
:key="item.id+''+index"
|
||||
:value="item"></el-option>
|
||||
</el-select>
|
||||
<br>
|
||||
<el-tag v-for="item in vipTags"
|
||||
:key="item.vip_label_id"
|
||||
closable
|
||||
class="tags"
|
||||
@close="delLabel(item.vip_label_id)">
|
||||
{{item.name}}
|
||||
</el-tag>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="text" size="small">标签数量:{{vipTags.length}}/20</el-button>
|
||||
</span>
|
||||
</el-dialog>`,
|
||||
props: {
|
||||
'show': {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
'vid': {
|
||||
type: String,
|
||||
default: '',
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
vipTags: [],//当前会员的标签列表
|
||||
tagList: [],//标签列表
|
||||
choose_tag: {},
|
||||
tag_keyword: '',
|
||||
tag_page: 1,
|
||||
tag_canLoad: true,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
closeDialog() {
|
||||
this.vipTags = [];
|
||||
this.$emit('end');
|
||||
},
|
||||
//搜索会员标签
|
||||
searchTag(value) {
|
||||
this.tag_page = 0;
|
||||
this.tag_keyword = value;
|
||||
this.tag_canLoad = true;
|
||||
this.getTagList();
|
||||
},
|
||||
//获取会员标签列表
|
||||
getTagList() {
|
||||
if (!this.tag_canLoad) {
|
||||
return;
|
||||
}
|
||||
this.tag_canLoad = false;
|
||||
this.sendRequest('Retail/VipLabel/getVipLabel', {
|
||||
data: {
|
||||
page: this.tag_page,
|
||||
pageSize: 20,
|
||||
name: this.tag_keyword,
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
if (this.tag_page != 1) {
|
||||
this.tagList.push.apply(this.tagList, res.data.list);
|
||||
} else {
|
||||
this.tagList = res.data.list;
|
||||
}
|
||||
this.tag_page = this.tag_page + 1;
|
||||
this.$nextTick(() => {
|
||||
if (res.data.list.length > 10) {
|
||||
this.tag_canLoad = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取当前会员标签
|
||||
getUserLabel() {
|
||||
this.sendRequest('Retail/VipLabel/getUserLabel', {
|
||||
data: {
|
||||
vid: this.vid
|
||||
},
|
||||
success: res => {
|
||||
if (res.status == 1) {
|
||||
this.vipTags = res.data.list;
|
||||
} else {
|
||||
this.vipTags = [];
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//选择会员标签
|
||||
chooseTag(item) {
|
||||
if (item) {
|
||||
this.choose_tag = {...item};
|
||||
let obj = {
|
||||
vip_label_id: item.id,
|
||||
name: item.name,
|
||||
};
|
||||
this.vipTags.push(obj);
|
||||
|
||||
this.sendRequest('Retail/VipLabel/addUserLabel', {
|
||||
data: {
|
||||
vip_label_id: this.choose_tag.id,
|
||||
vid: this.vid
|
||||
},
|
||||
success: res => {
|
||||
if (res.status == 1) {
|
||||
this.choose_tag = {};
|
||||
this.$message.success(res.message);
|
||||
this.getTagList();
|
||||
}else{
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//验证会员标签是否禁用
|
||||
verifyTag(id) {
|
||||
for (let i = 0; i < this.vipTags.length; i++) {
|
||||
if (this.vipTags[i].vip_label_id == id) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
//删除会员已选标签
|
||||
delLabel(id) {
|
||||
this.sendRequest('Retail/VipLabel/delUserLabel', {
|
||||
data: {
|
||||
vip_label_id: id,
|
||||
vid: this.vid
|
||||
},
|
||||
success: res => {
|
||||
if (res.status == 1) {
|
||||
this.getUserLabel();//获取会员标签
|
||||
this.$message.success(res.message);
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getTagList();//获取可选会员标签
|
||||
this.getUserLabel();//获取会员标签
|
||||
},
|
||||
watch: {
|
||||
show(n) {
|
||||
if (n) {
|
||||
this.getTagList();//获取可选会员标签
|
||||
this.getUserLabel();//获取会员标签
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,364 @@
|
||||
/**
|
||||
* 小程序用户管理列表
|
||||
*/
|
||||
Vue.component('mini-program-user-index', {
|
||||
template: `<div>
|
||||
<div style="margin-right: 10px;margin-bottom: 10px;display: inline-block;">
|
||||
<date-picker-range :date-time.sync="searchForm.time"
|
||||
:start-placeholder="'注册时间(起)'"
|
||||
:end-placeholder="'注册时间(止)'"></date-picker-range>
|
||||
|
||||
<el-input v-model="searchForm.nick_name" style="width: 200px"
|
||||
placeholder="昵称"
|
||||
@keydown.enter.exact.native.prevent="currentChange(1)"
|
||||
size="small"></el-input>
|
||||
|
||||
<select-store :store-id.sync="searchForm.store_id" :show-status="true" :placeholder="'所属门店'"></select-store>
|
||||
|
||||
<el-button type="primary" size="small" @click="currentChange(1)">查询</el-button>
|
||||
|
||||
<el-button @click="reset" type="primary" plain size="small">重置</el-button>
|
||||
|
||||
<el-button v-if="operate.export&&(userType==1||userType==2&&storeAuth.data_export==1)"
|
||||
size="small"
|
||||
@click="exportData">导出用户信息
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-loading="loading">
|
||||
<el-table :data="vipList" size="small" border style="width: calc(100vw - 208px);box-sizing: border-box;">
|
||||
<el-table-column align="center" type="index" label="序号" width="60"></el-table-column>
|
||||
<el-table-column align="center" label="头像" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-avatar :size="40" :src="scope.row.avatar"></el-avatar>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="nickname" label="昵称" min-width="180"></el-table-column>
|
||||
<el-table-column align="center" label="所属门店" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.storetag || '------'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="mobile_phone" min-width="120" label="自提手机号"></el-table-column>
|
||||
<el-table-column align="center" prop="link_name" min-width="100" label="自提姓名"></el-table-column>
|
||||
<el-table-column align="center" prop="add_time" min-width="130" label="注册时间"></el-table-column>
|
||||
<el-table-column align="center" label="操作" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="userTypeChange(scope.row)"
|
||||
v-if="operate.changeRole&&(userType==1||userType==2&&storeAuth.store_ordinary_operation_vip==1)">变更
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChange"
|
||||
@current-change="currentChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:current-page="searchForm.page"
|
||||
:pager-count="5"
|
||||
:page-sizes="[10,20,30,40,50,60,70,80,90]"
|
||||
:page-size="10"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
<change-user-type :show="showEditDialog" :user-type="userType" :data="editData" @end="userTypeChangeEnd"></change-user-type>
|
||||
</div>`,
|
||||
props: {
|
||||
'userType': {
|
||||
type: Number,
|
||||
default: 1,//1商户 2门店
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
searchForm: {
|
||||
nick_name: '',
|
||||
time: '',
|
||||
store_id: '',
|
||||
page: 1, // 分页
|
||||
limit: 10, // 每页显示条数
|
||||
},
|
||||
vipList: [],
|
||||
loading: false,
|
||||
total: 0, // 总数 int类型
|
||||
showEditDialog: false, // 变更弹出框
|
||||
editData: {
|
||||
id: 0, // id
|
||||
nickname: '', // 昵称
|
||||
},
|
||||
requestUrl: {
|
||||
getData: {
|
||||
1: 'Retail/Vip/getXcxUser',
|
||||
2: 'Retail/Vips/store_xcxvip_list',
|
||||
},
|
||||
export: {
|
||||
1: '/index.php/Retail/Vip/xcxUserExport',
|
||||
2: '/index.php/Retail/Vips/store_xcxvip_list_export',
|
||||
},
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 修改页码
|
||||
currentChange(val) {
|
||||
this.searchForm.page = val;
|
||||
this.getData();
|
||||
},
|
||||
// 修改每页显示数量
|
||||
sizeChange(val) {
|
||||
this.searchForm.limit = val;
|
||||
this.searchForm.page = 1;
|
||||
this.getData();
|
||||
},
|
||||
getData() {
|
||||
this.sendRequest(this.requestUrl.getData[this.userType], {
|
||||
data: {
|
||||
page: this.searchForm.page,
|
||||
limit: this.searchForm.limit,
|
||||
search_info: JSON.stringify({
|
||||
store_id: this.searchForm.store_id,
|
||||
nick_name: this.searchForm.nick_name,
|
||||
time: this.searchForm.time
|
||||
})
|
||||
},
|
||||
success: (res) => {
|
||||
this.loading = false;
|
||||
if (res.status == 1) {
|
||||
this.vipList = res.list;
|
||||
this.total = res.count;
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.$confirm('确定导出数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info'
|
||||
}).then(() => {
|
||||
window.location.href = this.requestUrl.export[this.userType] + '?nick_name=' + this.searchForm.nick_name + '&time=' + this.searchForm.time;
|
||||
});
|
||||
},
|
||||
// 显示用户类型转变弹框
|
||||
userTypeChange(item) {
|
||||
this.editData = {
|
||||
id: item.id,
|
||||
nickname: item.nickname,
|
||||
};
|
||||
this.showEditDialog = true;
|
||||
},
|
||||
userTypeChangeEnd() {
|
||||
this.showEditDialog = false;
|
||||
this.getData();
|
||||
},
|
||||
// 重置搜索表单
|
||||
reset() {
|
||||
this.searchForm = {
|
||||
nick_name: '',
|
||||
time: '',
|
||||
page: 1, // 分页
|
||||
limit: 10, // 每页显示条数
|
||||
};
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.checkOperateAuth((this.userType == 1 ? {
|
||||
export: '/index.php/Retail/Vip/xcxvip_list_export',
|
||||
changeRole: '/index.php/Retail/Vip/changeRole',
|
||||
} : {
|
||||
export: '/index.php/Retail/Vips/store_xcxvip_list_export',
|
||||
changeRole: '/index.php/Retail/Vips/changeRole',
|
||||
}), (data) => {
|
||||
this.operate = data;
|
||||
});
|
||||
this.getData();
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* 变更小程序用户
|
||||
*/
|
||||
Vue.component('change-user-type', {
|
||||
template: `<el-dialog :visible.sync="show" title="变更用户类型"
|
||||
:append-to-body="true" :close-on-click-modal="false"
|
||||
:before-close="clearDialog" width="500px">
|
||||
<el-form label-width="100px"
|
||||
size="small"
|
||||
ref="editForm"
|
||||
:rules="rules" :model="editForm">
|
||||
<el-form-item label="角色:" prop="type">
|
||||
<el-radio-group v-model="editForm.type" @change="changeType">
|
||||
<el-radio-button :label="1">常规会员</el-radio-button>
|
||||
<el-radio-button :label="2">PLUS会员</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="过期时间:" prop="end_time" v-if="editForm.type==2">
|
||||
<el-date-picker
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
v-model="editForm.end_time"
|
||||
type="datetime"
|
||||
range-separator="至"
|
||||
placeholder="PLUS会员过期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="等级:" prop="grade_id" v-else>
|
||||
<select-vip-grade :grade-id.sync="editForm.grade_id"
|
||||
:show-discount="true"
|
||||
:placeholder="'变更等级'"></select-vip-grade>
|
||||
<span style="margin-left: 5px;color: #409EFF;">默认无等级</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="userType==1" label="所属门店:">
|
||||
<select-store :store-id.sync="editForm.store_id"
|
||||
:show-status="true"
|
||||
:placeholder="'所属门店'"></select-store>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名:" prop="name">
|
||||
<el-input style="width:220px" v-model="editForm.name" placeholder="会员姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="昵称:" prop="nickname">
|
||||
<el-input style="width:220px" v-model="editForm.nickname" placeholder="会员昵称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号:" prop="mobile_phone">
|
||||
<el-input style="width:220px" v-model="editForm.mobile_phone"
|
||||
onkeyup="value=value.replace(/[^\\d]/g,'')" placeholder="会员手机号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="余额:" prop="balance">
|
||||
<el-input style="width:220px" v-model="editForm.balance"
|
||||
onkeyup="value=value.replace(/[^\\d|.]/g,'')" placeholder="会员卡余额"></el-input>
|
||||
<span style="margin-left: 5px;color: #409EFF;">默认余额为0</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="生日:" prop="birthday">
|
||||
<el-date-picker v-model="editForm.birthday"
|
||||
size="small"
|
||||
placeholder="会员生日"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0" style="text-align: center">
|
||||
<el-button :loading="subLoading" type="primary" size="medium" @click="submitForm">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>`,
|
||||
props: {
|
||||
'show': {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
'userType': {
|
||||
type: Number,
|
||||
default: 1,//1商户 2门店
|
||||
},
|
||||
'data': {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
id: 0,
|
||||
nickname: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
editForm: {
|
||||
id: 0, // id
|
||||
type: '', // 类型
|
||||
grade_id: '', // 等级
|
||||
store_id: '', // 门店ID
|
||||
name: '', // 姓名
|
||||
nickname: '', // 昵称
|
||||
mobile_phone: '', // 手机号
|
||||
birthday: '', // 生日
|
||||
balance: '', // 余额
|
||||
end_time: '', // plus会员过期时间
|
||||
},
|
||||
rules: {
|
||||
type: [{required: true, message: '请选择会员类型', trigger: 'change'}],
|
||||
// store_id: [{required: true, message: '请选择会员直属门店', trigger: 'change'}],
|
||||
grade_id: [{required: false, message: '请选择会员等级', trigger: 'change'}],
|
||||
name: [{required: true, message: '请输入会员姓名', trigger: 'change'}],
|
||||
nickname: [{required: false, message: '请输入会员姓名', trigger: 'change'}],
|
||||
balance: [{required: true, message: '请输入会员余额', trigger: 'change'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d{0,2})$/;
|
||||
if (value === '' || value === null || value == undefined) {
|
||||
callback(new Error("请输入会员余额"));
|
||||
} else if (reg.test(value) == false) {
|
||||
callback(new Error("请输入正确的会员余额"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
mobile_phone: [{required: true, message: '请输入会员手机号', trigger: 'change'}, {
|
||||
validator: function (rule, value, callback) {
|
||||
if (value == '') {
|
||||
callback(new Error("请输入会员手机号"));
|
||||
} else if (!(/^[1][3456789][0-9]{9}$/).test(value)) {
|
||||
callback(new Error("请输入正确的会员手机号"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
end_time: [{required: true, message: '请选择PLUS会员过期时间', trigger: 'change'}],
|
||||
},//变更的规则
|
||||
subLoading: false,
|
||||
requestUrl: {
|
||||
1: 'Retail/Vip/changeRole',
|
||||
2: 'Retail/Vips/changeRole',
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
clearDialog() {
|
||||
this.$refs.editForm.resetFields();
|
||||
this.$emit('end');
|
||||
},
|
||||
changeType(val) {
|
||||
this.editForm.grade_id = '';
|
||||
if (val == 1) {
|
||||
this.$refs.editForm.validateField('grade_id');
|
||||
}
|
||||
},
|
||||
// 提交表单
|
||||
submitForm() {
|
||||
this.$refs.editForm.validate((valid) => {
|
||||
if (!valid) {
|
||||
return this.$message.warning('请检查表单信息');
|
||||
}
|
||||
this.$confirm('确认变更该普通用户的信息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'info'
|
||||
}).then(() => {
|
||||
this.subLoading = true;
|
||||
this.sendRequest(this.requestUrl[this.userType], {
|
||||
data: this.editForm,
|
||||
success: (res) => {
|
||||
this.subLoading = false;
|
||||
if (res.status == 1) {
|
||||
this.$message.success(res.message);
|
||||
this.clearDialog();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
show(n) {
|
||||
if (n) {
|
||||
this.editForm.id = this.data.id;
|
||||
this.editForm.nickname = this.data.nickname;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,256 @@
|
||||
/**
|
||||
* 会员余额记录列表
|
||||
*/
|
||||
Vue.component('vip-balance-record', {
|
||||
template: `<div>
|
||||
<el-form size="small" :inline="true">
|
||||
<el-form-item>
|
||||
<date-picker-range :date-time.sync="req_data.time"></date-picker-range>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="req_data.keyword"
|
||||
placeholder="昵称/姓名/实体卡/手机号" clearable
|
||||
@keydown.enter.exact.native.prevent="searchData"
|
||||
style="width: 220px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="userType==1">
|
||||
<select-store :store-id.sync="req_data.store_id"
|
||||
:show-status="true"
|
||||
:placeholder="'产生记录的门店'"></select-store>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="req_data.scene_type"
|
||||
clearable placeholder="选择场景" style="width: 220px;">
|
||||
<el-option v-for="(val,key) in sceneType"
|
||||
:label="val.name"
|
||||
:value="val.type"
|
||||
:key="key"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="req_data.type" size="small" clearable placeholder="选择类型" style="width: 220px;">
|
||||
<el-option v-for="(val,key) in seekType"
|
||||
:label="val.name"
|
||||
:value="val.type"
|
||||
:key="key"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="searchData" size="small">查询</el-button>
|
||||
<el-button type="primary" plain @click="reset" size="small">重置</el-button>
|
||||
<el-button v-if="(userType==1||storeAuth.data_export==1) && operate.export"
|
||||
@click="exportExcel">导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="table-top-card-box">
|
||||
<div class="table-top-card">
|
||||
<div class="table-top-card-header">消费总金额</div>
|
||||
<div class="table-top-card-body">{{ sumData.consumption }}</div>
|
||||
</div>
|
||||
<div class="table-top-card">
|
||||
<div class="table-top-card-header">扣除总金额</div>
|
||||
<div class="table-top-card-body">{{ sumData.deduct }}</div>
|
||||
</div>
|
||||
<div class="table-top-card">
|
||||
<div class="table-top-card-header">消费退款总金额</div>
|
||||
<div class="table-top-card-body">{{ sumData.refund }}</div>
|
||||
</div>
|
||||
<div class="table-top-card">
|
||||
<div class="table-top-card-header">充值退款总金额</div>
|
||||
<div class="table-top-card-body">{{ sumData.recharge_refund }}</div>
|
||||
</div>
|
||||
<div class="table-top-card">
|
||||
<div class="table-top-card-header">充值总金额</div>
|
||||
<div class="table-top-card-body">{{ sumData.recharge }}</div>
|
||||
</div>
|
||||
<div class="table-top-card">
|
||||
<div class="table-top-card-header">活动赠送总金额</div>
|
||||
<div class="table-top-card-body">{{ sumData.activity }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<el-table :data="orderList" :highlight-current-row="true" border size="small"
|
||||
:header-cell-style="{background:'#F5F7FA',color:'#606266'}"
|
||||
style="width: calc(100vw - 208px);">
|
||||
<el-table-column align="center" type="index" label="序号" width="50"></el-table-column>
|
||||
<el-table-column align="center" prop="name" label="姓名" min-width="80" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column align="center" prop="nickname" label="昵称" min-width="100" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column align="center" prop="mobile_phone" label="手机" min-width="110" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column align="center" prop="card_key" label="实体卡" min-width="80" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column align="center" prop="all_money" label="金额" min-width="80" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column align="center" prop="scene_name" label="场景" min-width="100"></el-table-column>
|
||||
<el-table-column align="center" prop="type_name" label="类型" min-width="80"></el-table-column>
|
||||
<el-table-column align="center" prop="store_name" label="门店" min-width="100" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column align="center" prop="add_time" label="时间" :show-overflow-tooltip="true" min-width="140"></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChange"
|
||||
@current-change="currentChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:current-page="page"
|
||||
:pager-count="5"
|
||||
:page-sizes="[10,20,30,40,50,60,70,80,90]"
|
||||
:page-size="10"
|
||||
:total="count">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>`,
|
||||
props: {
|
||||
'userType': {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},//1商户 2门店
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
req_data: {
|
||||
time: '', // 时间
|
||||
keyword: '', // 实体卡、手机号
|
||||
store_id: '', // 门店
|
||||
type: '', // 类型
|
||||
scene_type: '', //场景
|
||||
},
|
||||
sumData: {
|
||||
consumption: 0,
|
||||
deduct: 0,
|
||||
refund: 0,
|
||||
recharge_refund: 0,
|
||||
recharge: 0,
|
||||
activity: 0,
|
||||
},
|
||||
orderList: [], // 充值记录列表
|
||||
page: 1, // 分页
|
||||
limit: 10, // 每页显示条数
|
||||
count: 0, // 总数 int类型
|
||||
seekType: [
|
||||
{type: 1, name: '充值'},
|
||||
{type: 2, name: '消费'},
|
||||
{type: 3, name: '编辑增加'},
|
||||
{type: 4, name: '编辑减少'},
|
||||
{type: 5, name: '退款增加'},
|
||||
{type: 6, name: '红包充值'},
|
||||
{type: 7, name: '大转盘充值'},
|
||||
{type: 8, name: '礼品卡充值'},
|
||||
{type: 9, name: '充值退款'}
|
||||
],// 类型
|
||||
sceneType: [
|
||||
{type: 1, name: '收银机'},
|
||||
{type: 2, name: '商户后台'},
|
||||
{type: 3, name: '门店后台'},
|
||||
{type: 4, name: '小程序'},
|
||||
{type: 5, name: '公众号'},
|
||||
{type: 6, name: '小助手'},
|
||||
],// 场景
|
||||
requestUrl: {
|
||||
sumData: {
|
||||
1: 'Retail/Vipbalance/getBalanceTotal',
|
||||
2: 'Retail/Vipsbalance/getBalanceTotal',
|
||||
},
|
||||
getData: {
|
||||
1: 'Retail/Vipbalance/balanceList',
|
||||
2: 'Retail/Vipsbalance/balanceList',
|
||||
},
|
||||
export: {
|
||||
1: '/index.php/Retail/Vipbalance/balanceExport',
|
||||
2: '/index.php/Retail/Vipsbalance/balanceExport',
|
||||
},
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
searchData() {
|
||||
this.getSumData();
|
||||
this.currentChange(1);
|
||||
},
|
||||
// 重置搜索项
|
||||
reset() {
|
||||
this.req_data = {
|
||||
time: '',
|
||||
keyword: '',
|
||||
store_id: '',
|
||||
type: '',
|
||||
mode: '',
|
||||
};
|
||||
this.searchData();
|
||||
},
|
||||
//获取统计数据
|
||||
getSumData() {
|
||||
this.sendRequest(this.requestUrl.sumData[this.userType], {
|
||||
data: {
|
||||
req_data: JSON.stringify(this.req_data),
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.sumData = res.data;
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取余额记录
|
||||
getVipBalanceList() {
|
||||
this.sendRequest(this.requestUrl.getData[this.userType], {
|
||||
data: {
|
||||
req_data: JSON.stringify(this.req_data),
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.orderList = [];
|
||||
this.orderList = res.data.list;
|
||||
this.count = res.data.count;
|
||||
} else {
|
||||
this.count = 0;
|
||||
this.orderList = [];
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 分页
|
||||
currentChange(val) {
|
||||
this.page = val;
|
||||
this.getVipBalanceList();
|
||||
},
|
||||
|
||||
// 显示数量
|
||||
sizeChange(val) {
|
||||
this.limit = val;
|
||||
this.page = 1;
|
||||
this.getVipBalanceList();
|
||||
},
|
||||
|
||||
// 导出
|
||||
exportExcel() {
|
||||
if (!this.req_data.time) {
|
||||
this.$confirm('不选择时间则默认导出当日记录', '确定导出数据吗?', {
|
||||
confirmButtonText: '导出',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
window.location.href = this.requestUrl.export[this.userType] + '?req_data=' + JSON.stringify(this.req_data);
|
||||
}).catch(() => {
|
||||
});
|
||||
} else {
|
||||
window.location.href = this.requestUrl.export[this.userType] + '?req_data=' + JSON.stringify(this.req_data);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.searchData();
|
||||
this.checkOperateAuth({
|
||||
export: this.requestUrl.export[this.userType],
|
||||
}, (data) => {
|
||||
this.operate = data;
|
||||
})
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,304 @@
|
||||
/**
|
||||
* 会员充值记录
|
||||
*/
|
||||
Vue.component('vip-recharge-record', {
|
||||
template: `<div>
|
||||
<el-form size="small" :inline="true">
|
||||
<el-form-item>
|
||||
<date-picker-range :date-time.sync="req_data.time"></date-picker-range>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="req_data.keyword"
|
||||
placeholder="实体卡/手机号"
|
||||
@keydown.enter.exact.native.prevent="searchData"
|
||||
clearable style="width: 220px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="userType==1">
|
||||
<select-store :store-id.sync="req_data.store_id"
|
||||
:show-status="true"
|
||||
:placeholder="'充值门店'"></select-store>
|
||||
</el-form-item>
|
||||
<el-form-item v-else>
|
||||
<el-select v-model="req_data.search_type"
|
||||
clearable
|
||||
placeholder="记录类型">
|
||||
<el-option label="本店充值" :value="1"></el-option>
|
||||
<el-option label="本店会员" :value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-select v-model="req_data.scene_type"
|
||||
clearable
|
||||
placeholder="充值场景">
|
||||
<el-option v-for="(val,index) in sceneType"
|
||||
:label="val.name"
|
||||
:value="val.type"
|
||||
:key="val.type"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="req_data.mode"
|
||||
clearable placeholder="充值方式">
|
||||
<el-option v-for="(val,key) in seekMode"
|
||||
:label="val.name"
|
||||
:value="val.mode"
|
||||
:key="val.mode"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="searchData" size="small">查询</el-button>
|
||||
<el-button type="primary" plain @click="reset" size="small">重置</el-button>
|
||||
|
||||
<el-button v-if="(userType==1||storeAuth.data_export==1) && operate.export" @click="exportExcel" size="small">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="table-top-card-box">
|
||||
<div class="table-top-card">
|
||||
<div class="table-top-card-header">充值金额</div>
|
||||
<div class="table-top-card-body">{{ sumData.money }}</div>
|
||||
</div>
|
||||
<div class="table-top-card">
|
||||
<div class="table-top-card-header">赠送金额</div>
|
||||
<div class="table-top-card-body">{{ sumData.give_money }}</div>
|
||||
</div>
|
||||
<div class="table-top-card">
|
||||
<div class="table-top-card-header">到账金额</div>
|
||||
<div class="table-top-card-body">{{ sumData.all_money }}</div>
|
||||
</div>
|
||||
<div class="table-top-card">
|
||||
<div class="table-top-card-header">代金券金额</div>
|
||||
<div class="table-top-card-body">{{ sumData.pay_coupon_money }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<el-table :data="rechargeList" size="small" :highlight-current-row="true" border
|
||||
:header-cell-style="{background:'#F5F7FA',color:'#606266'}"
|
||||
style="width: 100%">
|
||||
<el-table-column align="center" type="index" label="序号" width="50" fixed="left"></el-table-column>
|
||||
<el-table-column align="center" prop="name" label="姓名" min-width="100" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column align="center" prop="nickname" label="昵称" min-width="100" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column align="center" prop="mobile_phone" label="手机号" min-width="100"></el-table-column>
|
||||
<el-table-column align="center" prop="card_key" label="实体卡" min-width="100" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column align="center" prop="store_name" label="充值门店" min-width="100"></el-table-column>
|
||||
<el-table-column align="center" prop="scene_name" label="充值场景" min-width="80"></el-table-column>
|
||||
<el-table-column align="center" prop="recharge_mode" label="充值方式" min-width="80"></el-table-column>
|
||||
<el-table-column align="center" prop="money" label="实付金额" min-width="80"></el-table-column>
|
||||
<el-table-column align="center" prop="give_money" label="赠送金额" min-width="80"></el-table-column>
|
||||
<el-table-column align="center" prop="all_money" label="到账金额" min-width="80"></el-table-column>
|
||||
<el-table-column align="center" prop="pay_coupon_fee" label="代金券" min-width="80"></el-table-column>
|
||||
<el-table-column align="center" prop="aging_repay_name" label="到账方式" min-width="80"></el-table-column>
|
||||
<el-table-column align="center" prop="add_time" label="充值时间" min-width="140"></el-table-column>
|
||||
<el-table-column align="center" prop="remark" label="备注" min-width="180"></el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="80" v-if="operate.wifiPrint">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="wifiPrint(scope.row.pay_order_id)" size="mini">wifi打印
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChange"
|
||||
@current-change="currentChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:current-page="page"
|
||||
:pager-count="5"
|
||||
:page-sizes="[10,20,30,40,50,60,70,80,90]"
|
||||
:page-size="10"
|
||||
:total="count">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>`,
|
||||
props: {
|
||||
'userType': {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},//1商户 2门店
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operate: {},
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}]
|
||||
},
|
||||
req_data: {
|
||||
time: '', // 充值截止时间
|
||||
keyword: '', // 实体卡、手机号
|
||||
store_id: '', // 充值门店
|
||||
scene_type: '', // 充值类型
|
||||
search_type: '', // 充值类型
|
||||
mode: '', // 充值方式
|
||||
},// 搜索数据
|
||||
rechargeList: [], // 充值记录列表
|
||||
sumData: {
|
||||
money: 0, // 充值金额
|
||||
give_money: 0, // 赠送金额
|
||||
all_money: 0, // 到账金额
|
||||
pay_coupon_money: 0,//代金券金额
|
||||
},
|
||||
page: 1, // 分页
|
||||
limit: 10, // 每页显示条数
|
||||
count: 0, // 总数 int类型
|
||||
sceneType: [
|
||||
{type: 1, name: '收银机'},
|
||||
{type: 2, name: '商户后台'},
|
||||
{type: 3, name: '门店后台'},
|
||||
{type: 4, name: '小程序'},
|
||||
{type: 5, name: '公众号'},
|
||||
{type: 6, name: '小助手'},
|
||||
],// 场景
|
||||
seekMode: [
|
||||
{mode: 1, name: '现金'},
|
||||
{mode: 2, name: '微信'},
|
||||
{mode: 3, name: '支付宝'},
|
||||
{mode: 4, name: '后台修改'},
|
||||
],// 充值方式
|
||||
requestUrl: {
|
||||
sumData: {
|
||||
1: 'Retail/Viprecharge/rechargeTotal',
|
||||
2: 'Retail/Vipsbalance/rechargeTotal',
|
||||
},
|
||||
getData: {
|
||||
1: 'Retail/Viprecharge/vipRechargeList',
|
||||
2: 'Retail/Vipsbalance/rechargeList',
|
||||
},
|
||||
export: {
|
||||
1: '/index.php/Retail/Viprecharge/rechargeExport',
|
||||
2: '/index.php/Retail/Vipsbalance/rechargeExport',
|
||||
},
|
||||
wifiPrint: '/index.php/Retail/Vipsbalance/wifiPrintRechargeOrder',
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
searchData() {
|
||||
this.getSumData();
|
||||
this.currentChange(1);
|
||||
},
|
||||
//获取统计数据
|
||||
getSumData() {
|
||||
this.sendRequest(this.requestUrl.sumData[this.userType], {
|
||||
data: {
|
||||
req_data: JSON.stringify(this.req_data),
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.sumData = res.data;
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取充值记录
|
||||
getVipRechargeList() {
|
||||
this.sendRequest(this.requestUrl.getData[this.userType], {
|
||||
data: {
|
||||
req_data: JSON.stringify(this.req_data),
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.rechargeList = res.data.list;
|
||||
this.count = res.data.count;
|
||||
} else {
|
||||
this.rechargeList = [];
|
||||
this.count = 0;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
wifiPrint(order_id) {
|
||||
this.sendRequest(this.requestUrl.wifiPrint, {
|
||||
data: {order_id: order_id},
|
||||
success: (res) => {
|
||||
if (res.status == 1) {
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 重置表单
|
||||
reset() {
|
||||
this.req_data = {
|
||||
time: '', // 充值截止时间
|
||||
keyword: '', // 实体卡、手机号
|
||||
store_id: '', // 充值门店
|
||||
scene_type: '', // 充值类型
|
||||
mode: '', // 充值方式
|
||||
};
|
||||
this.getVipRechargeList();
|
||||
},
|
||||
|
||||
// 分页
|
||||
currentChange(val) {
|
||||
this.page = val;
|
||||
this.getVipRechargeList();
|
||||
},
|
||||
|
||||
// 显示数量
|
||||
sizeChange(val) {
|
||||
this.limit = val;
|
||||
this.searchData();
|
||||
},
|
||||
|
||||
// 导出
|
||||
exportExcel() {
|
||||
if (!this.req_data.time) {
|
||||
this.$confirm('不选择时间则默认导出当日记录', '确定导出数据吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
window.location.href = this.requestUrl.export[this.userType] + '?req_data=' + JSON.stringify(this.req_data);
|
||||
}).catch(() => {
|
||||
});
|
||||
} else {
|
||||
window.location.href = this.requestUrl.export[this.userType] + '?req_data=' + JSON.stringify(this.req_data);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
this.searchData();
|
||||
let obj = {
|
||||
export: this.requestUrl.export[this.userType],
|
||||
};
|
||||
this.userType == 2 && (obj.wifiPrint = this.requestUrl.wifiPrint);
|
||||
this.checkOperateAuth(obj, (data) => {
|
||||
this.operate = data;
|
||||
})
|
||||
},
|
||||
});
|
||||
在新工单中引用
屏蔽一个用户