This commit is contained in:
邱贞招 2025-01-10 22:07:59 +08:00
parent b989fca1df
commit 173aab9aa4
6 changed files with 254 additions and 140 deletions

View File

@ -6,7 +6,7 @@ ENV = 'development'
# 共享空间/开发环境 # 共享空间/开发环境
# VUE_APP_BASE_API = 'https://testcha.chuangtewl.com/prod-api' # VUE_APP_BASE_API = 'https://testcha.chuangtewl.com/prod-api'
VUE_APP_BASE_API = 'http://192.168.2.63:8089' VUE_APP_BASE_API = 'http://192.168.2.43:8089'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -205,7 +205,7 @@ export default {
name: "Rule", name: "Rule",
mixins: [$showColumns], mixins: [$showColumns],
dicts: ['ss_fee_rule_mode'], dicts: ['ss_fee_rule_mode'],
props: ['userId', 'roomId'], props: ['merchantId', 'roomId'],
data() { data() {
return { return {
// //
@ -275,7 +275,7 @@ export default {
}; };
}, },
created() { created() {
if(this.roomId && this.roomId != 0){ if(this.roomId && this.roomId != 0){
this.queryParams.roomId = this.roomId; this.queryParams.roomId = this.roomId;
this.queryParams.type2 = null; this.queryParams.type2 = null;
@ -290,18 +290,18 @@ export default {
pageSize: 999, pageSize: 999,
userType: '01' userType: '01'
} }
if(this.userId) { if(this.merchantId) {
params.userId = this.userId params.merchantId = this.merchantId
} }
listUser(params).then(response => { listUser(params).then(response => {
this.merchantOptions = response.rows; this.merchantOptions = response.rows;
if(this.userId) { if(this.merchantId) {
// merchantOptionsuserId // merchantOptionsmerchantId
const merchant = this.merchantOptions.find(item => item.userId === this.userId); const merchant = this.merchantOptions.find(item => item.userId === this.userId);
if(merchant) { if(merchant) {
this.queryParams.merchantId = merchant.userId; this.queryParams.merchantId = merchant.userId;
// //
this.getRoomList(merchant.userId); this.getRoomList(merchant.userId);
} }
} }
@ -317,7 +317,7 @@ export default {
} }
listRoom(params).then(response => { listRoom(params).then(response => {
this.roomOptions = response.rows; this.roomOptions = response.rows;
}); });
}, },
// () // ()
@ -345,8 +345,8 @@ export default {
/** 查询收费模板列表 */ /** 查询收费模板列表 */
getList() { getList() {
this.loading = true; this.loading = true;
if(this.userId && this.userId != 0){ if(this.merchantId && this.merchantId != 0){
this.queryParams.userId = this.userId; this.queryParams.merchantId = this.merchantId;
} }
listRule(this.queryParams).then(response => { listRule(this.queryParams).then(response => {
this.ruleList = response.rows; this.ruleList = response.rows;
@ -448,4 +448,4 @@ export default {
} }
} }
}; };
</script> </script>

View File

@ -18,8 +18,8 @@
<div class="store-image"> <div class="store-image">
<el-carousel height="300px" indicator-position="outside" :autoplay="true" trigger="click" arrow="always"> <el-carousel height="300px" indicator-position="outside" :autoplay="true" trigger="click" arrow="always">
<el-carousel-item v-for="(url, index) in storeData.pictures" :key="index"> <el-carousel-item v-for="(url, index) in storeData.pictures" :key="index">
<el-image <el-image
:src="url" :src="url"
fit="fill" fit="fill"
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
> >
@ -275,7 +275,7 @@ export default {
window.removeEventListener('resize', this.resizeChart); window.removeEventListener('resize', this.resizeChart);
}, },
methods: { methods: {
getStatusType(status) { getStatusType(status) {
const statusMap = { const statusMap = {
0: 'info', 0: 'info',
@ -473,11 +473,9 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.store-detail { .store-detail {
padding: 20px; padding: 20px;
.store-image { .store-image {
width: 100%; width: 100%;
margin-bottom: 20px;
:deep(.el-carousel) { :deep(.el-carousel) {
.el-carousel__indicators { .el-carousel__indicators {
bottom: -20px; bottom: -20px;
@ -485,7 +483,7 @@ export default {
.el-carousel__arrow { .el-carousel__arrow {
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
&:hover { &:hover {
background-color: rgba(0, 0, 0, 0.7); background-color: rgba(0, 0, 0, 0.7);
} }
@ -493,12 +491,12 @@ export default {
.el-carousel__item { .el-carousel__item {
overflow: hidden; overflow: hidden;
.el-image { .el-image {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: block; display: block;
.image-slot { .image-slot {
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -714,4 +712,4 @@ export default {
:deep(.el-tag) { :deep(.el-tag) {
margin-right: 8px; margin-right: 8px;
} }
</style> </style>

View File

@ -1,50 +1,93 @@
<template> <template>
<el-dialog :visible.sync="visible" width="700px" title="用户配置" @open="onOpen"> <el-dialog :visible.sync="visible" title="用户配置" width="600px" append-to-body @open="onOpen">
<el-form ref="form" :model="form" :rules="rules" label-width="5em" v-loading="loading"> <el-form ref="form" :model="form" :rules="rules" label-width="120px" v-loading="loading">
<el-row v-if="showCurrent"> <!-- 管理员设置 -->
<form-col :span="span" label="当前用户" label-width="5em"> <el-card class="box-card" shadow="never">
{{form.userName}} <div slot="header">
</form-col> <span>管理员设置</span>
</el-row> </div>
<!-- <el-row>--> <el-form-item label="设备管理员" prop="deviceAdmin">
<!-- <group-title title="订单显示用户手机号"/>--> <el-switch
<!-- <form-col :span="10" label="是否开启" label-width="5em">--> v-model="form.deviceAdmin"
<!-- <el-switch v-model="form.showBillMobile" active-text="开启" inactive-text="不开启"/>--> :active-value="true"
<!-- </form-col>--> :inactive-value="false"
<!-- <form-col :span="14" label="单价" prop="showBillMobilePrice" v-if="form.showBillMobile">--> @change="onChangeDeviceAdmin"
<!-- <el-input v-model="form.showBillMobilePrice" :min="0" type="number" placeholder="请输入单价">--> />
<!-- <template #append> / </template>--> </el-form-item>
<!-- </el-input>--> </el-card>
<!-- </form-col>-->
<!-- </el-row>-->
<!-- <el-row>--> <!-- 订单设置 -->
<!-- <group-title title="风控配置"/>--> <el-card class="box-card" shadow="never">
<!-- <form-col :span="span" label="充值延迟到账" prop="arrivalDelay" label-width="7em">--> <div slot="header">
<!-- <el-input v-model="form.arrivalDelay" placeholder="请输入到账延迟时长">--> <span>订单设置</span>
<!-- <template #append>小时</template>--> </div>
<!-- </el-input>--> <el-form-item label="提前开始限制" prop="beforeTime">
<!-- </form-col>--> <el-input-number
<!-- </el-row>--> v-model="form.beforeTime"
<!-- <el-row >--> :min="0"
<!-- <group-title title="代理商配置"/>--> :precision="0"
<!-- <form-col :span="span" label="默认设备服务费" label-width="8em" prop="agentDeviceService">--> controls-position="right"
<!-- <el-input v-model="form.agentDeviceService" type="number" :min="0" placeholder="请输入默认设备服务费">--> style="width: 200px">
<!-- <template #append>%</template>--> <template slot="append">分钟</template>
<!-- </el-input>--> </el-input-number>
<!-- </form-col>--> <span class="help-text">开始前多少分钟可以使用</span>
<!-- <form-col :span="span" label="商户开关/充值设备" label-width="10em" prop="agentDeviceService">--> </el-form-item>
<!-- <el-switch v-model="form.agentAllowMchSwitch" active-text="允许" inactive-text="不允许"/>--> </el-card>
<!-- </form-col>-->
<!-- </el-row>-->
<el-row> <!-- 取消设置 -->
<group-title title="其他设置"/> <el-card class="box-card" shadow="never">
<form-col :span="8" label="是否为设备管理员" label-width="9em" prop="deviceAdmin"> <div slot="header">
<el-switch v-model="form.deviceAdmin" active-text="" inactive-text="" @change="onChangeDeviceAdmin"/> <span>取消设置</span>
</form-col> </div>
</el-row> <el-form-item label="取消时长" prop="agoCancel">
<el-input-number
v-model="form.agoCancel"
:min="0"
:precision="0"
controls-position="right"
style="width: 200px">
<template slot="append">分钟</template>
</el-input-number>
<span class="help-text">开始前多少分钟可以取消</span>
</el-form-item>
<el-form-item label="违约金" prop="penalty">
<el-input-number
v-model="form.penalty"
:min="0"
:max="1"
:precision="2"
:step="0.1"
controls-position="right"
style="width: 200px">
<template slot="append">%</template>
</el-input-number>
<span class="help-text">取消订单收取订单金额的比例</span>
</el-form-item>
</el-card>
<!-- 保洁设置 -->
<el-card class="box-card" shadow="never">
<div slot="header">
<span>保洁设置</span>
</div>
<el-form-item label="保洁时长" prop="cleanDuration">
<el-input-number
v-model="form.cleanDuration"
:min="0"
:precision="0"
controls-position="right"
style="width: 200px">
<template slot="append">分钟</template>
</el-input-number>
<span class="help-text">预计保洁所需时间</span>
</el-form-item>
<el-form-item label="保洁通知" prop="cleanNotice">
<el-radio-group v-model="form.cleanNotice">
<el-radio :label="1">通知给商户</el-radio>
<el-radio :label="2">通知给保洁</el-radio>
</el-radio-group>
</el-form-item>
</el-card>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :loading="submitLoading"> </el-button> <el-button type="primary" @click="submitForm" :loading="submitLoading"> </el-button>
@ -54,52 +97,60 @@
</template> </template>
<script> <script>
import LineField from '@/components/LineField/index.vue' import { getUser, updateUser } from '@/api/user/user';
import GroupTitle from '@/components/GroupTitle/index.vue'
import { SmUserType } from '@/utils/constants'
import {getUser ,updateUser } from '@/api/user/user';
export default { export default {
name: "UserConfigDialog", name: 'UserConfigDialog',
components: { GroupTitle, LineField },
props: { props: {
show: { show: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
userId: { userId: {
type: Number, type: [String, Number],
default: null, default: null
},
showCurrent: {
type: Boolean,
default: false,
}
},
computed: {
SmUserType() {
return SmUserType
},
visible: {
set(val) {
this.$emit('update:show', val);
},
get() {
return this.show;
}
} }
}, },
data() { data() {
return { return {
span: 12, visible: false,
form: {},
rules: {
showBillMobilePrice: [
{ required: true, message: '请输入单价', trigger: 'blur' }
]
},
loading: false, loading: false,
submitLoading: false, submitLoading: false,
form: {
beforeTime: 30,
agoCancel: 30,
penalty: 0.2,
cleanDuration: 30,
cleanNotice: 1,
deviceAdmin: undefined
},
rules: {
beforeTime: [
{ required: true, message: '请输入提前开始限制时间', trigger: 'blur' }
],
agoCancel: [
{ required: true, message: '请输入取消时长', trigger: 'blur' }
],
penalty: [
{ required: true, message: '请输入违约金比例', trigger: 'blur' }
],
cleanDuration: [
{ required: true, message: '请输入保洁时长', trigger: 'blur' }
],
cleanNotice: [
{ required: true, message: '请选择保洁通知对象', trigger: 'change' }
]
}
}
},
watch: {
show(val) {
this.visible = val;
},
visible(val) {
if (!val) {
this.$emit('update:show', false);
}
} }
}, },
methods: { methods: {
@ -107,44 +158,32 @@ export default {
if (this.userId != null) { if (this.userId != null) {
this.loading = true; this.loading = true;
getUser(this.userId).then(response => { getUser(this.userId).then(response => {
this.form = response.data; this.form = { ...this.form, ...response.data };
}).finally(() => { }).finally(() => {
this.loading = false; this.loading = false;
}) })
} else {
this.reset();
} }
}, },
/** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
if (this.form.userId != null) { this.submitLoading = true;
this.submitLoading = true; updateUser({
updateUser(this.form).then(res => { userId: this.userId,
this.$modal.msgSuccess("修改成功"); ...this.form
this.visible = false; }).then(() => {
this.$emit('success'); this.$modal.msgSuccess("修改成功");
}).finally(() => { this.$emit('success');
this.submitLoading = false; this.visible = false;
}) }).finally(() => {
} this.submitLoading = false;
});
} }
}); });
}, },
//
cancel() { cancel() {
this.visible = false; this.visible = false;
this.reset();
}, },
//
reset() {
this.form = {
userId: this.userId,
};
this.resetForm("form");
},
//
onChangeDeviceAdmin(val) { onChangeDeviceAdmin(val) {
if (val) { if (val) {
this.$confirm('【高危操作】是否确认设置用户为设备管理员?<br/>用户将可以通过微信小程序注册设备!', { this.$confirm('【高危操作】是否确认设置用户为设备管理员?<br/>用户将可以通过微信小程序注册设备!', {
@ -154,11 +193,92 @@ export default {
dangerouslyUseHTMLString: true dangerouslyUseHTMLString: true
}).then(() => { }).then(() => {
this.form.deviceAdmin = true; this.form.deviceAdmin = true;
}).catch((e) => { this.submitLoading = true;
updateUser({
userId: this.userId,
deviceAdmin: true
}).then(() => {
this.$modal.msgSuccess("设置成功");
this.$emit('success');
}).catch(() => {
this.form.deviceAdmin = false;
}).finally(() => {
this.submitLoading = false;
});
}).catch(() => {
this.form.deviceAdmin = false; this.form.deviceAdmin = false;
}); });
} else {
this.submitLoading = true;
updateUser({
userId: this.userId,
deviceAdmin: false
}).then(() => {
this.$modal.msgSuccess("取消成功");
this.$emit('success');
}).catch(() => {
this.form.deviceAdmin = true;
}).finally(() => {
this.submitLoading = false;
});
} }
}, }
} }
} }
</script> </script>
<style lang="scss" scoped>
.box-card {
margin-bottom: 15px;
&:last-child {
margin-bottom: 0;
}
:deep(.el-card__header) {
padding: 10px 15px;
border-bottom: 1px solid #ebeef5;
background-color: #fafafa;
span {
font-size: 14px;
font-weight: bold;
color: #303133;
}
}
:deep(.el-card__body) {
padding: 15px 20px;
}
}
.help-text {
margin-left: 10px;
color: #909399;
font-size: 13px;
}
.el-form-item {
margin-bottom: 18px;
&:last-child {
margin-bottom: 0;
}
}
:deep(.el-input-number) {
.el-input__inner {
text-align: left;
}
}
.el-radio-group {
.el-radio {
margin-right: 20px;
&:last-child {
margin-right: 0;
}
}
}
</style>

View File

@ -205,7 +205,7 @@
<device :userId="detail.userId"></device> <device :userId="detail.userId"></device>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="套餐列表" name="rules"> <el-tab-pane label="套餐列表" name="rules">
<rule :userId="detail.userId"></rule> <rule :merchantId="detail.userId"></rule>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="设施列表" name="equipments"> <el-tab-pane label="设施列表" name="equipments">
<equipment :userId="detail.userId"></equipment> <equipment :userId="detail.userId"></equipment>
@ -566,7 +566,7 @@ export default {
} }
] ]
}; };
if (this.dailyChart) { if (this.dailyChart) {
this.dailyChart.setOption(option); this.dailyChart.setOption(option);
} }
@ -662,7 +662,7 @@ export default {
} }
] ]
}; };
if (this.monthlyChart) { if (this.monthlyChart) {
this.monthlyChart.setOption(option); this.monthlyChart.setOption(option);
} }
@ -715,10 +715,6 @@ export default {
flex: 1; flex: 1;
} }
.statistics-cards {
margin-bottom: 20px;
}
.stat-card { .stat-card {
background: #fff; background: #fff;
border-radius: 4px; border-radius: 4px;
@ -851,4 +847,4 @@ export default {
.mb-2 { .mb-2 {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
</style> </style>

View File

@ -98,15 +98,15 @@
<span>{{ scope.row.withdrawAmount ? '¥' + scope.row.withdrawAmount : '¥0.00' }}</span> <span>{{ scope.row.withdrawAmount ? '¥' + scope.row.withdrawAmount : '¥0.00' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="店铺数" align="center" prop="storeCount"> <el-table-column label="店铺数" align="center" prop="storeNum">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.storeCount || 0 }}</span> <span>{{ scope.row.storeNum || 0 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="是否管理员" align="center" prop="isAdmin"> <el-table-column label="是否管理员" align="center" prop="deviceAdmin">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag size="small" :type="scope.row.isAdmin === 1 ? 'success' : 'info'"> <el-tag size="small" :type="scope.row.deviceAdmin ? 'success' : 'info'">
{{ scope.row.isAdmin === 1 ? '是' : '否' }} {{ scope.row.deviceAdmin ? '是' : '否' }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -134,7 +134,7 @@
type="text" type="text"
icon="el-icon-view" icon="el-icon-view"
@click="handleView(scope.row)" @click="handleView(scope.row)"
v-hasPermi="['system:smUser:detail']" v-hasPermi="['system:smUser:detail']"
>详情</el-button> >详情</el-button>
<el-button <el-button
size="mini" size="mini"
@ -194,7 +194,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="用户类型" prop="userType"> <el-form-item label="用户类型" prop="userType">
<el-select v-model="form.userType" placeholder="请选择用户类型"> <el-select v-model="form.userType" placeholder="请选择用户类型">
<el-option <el-option
v-for="dict in filteredUserTypes" v-for="dict in filteredUserTypes"