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 = 'http://192.168.2.63:8089'
VUE_APP_BASE_API = 'http://192.168.2.43:8089'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

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

View File

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

View File

@ -1,50 +1,93 @@
<template>
<el-dialog :visible.sync="visible" width="700px" title="用户配置" @open="onOpen">
<el-form ref="form" :model="form" :rules="rules" label-width="5em" v-loading="loading">
<el-row v-if="showCurrent">
<form-col :span="span" label="当前用户" label-width="5em">
{{form.userName}}
</form-col>
</el-row>
<!-- <el-row>-->
<!-- <group-title title="订单显示用户手机号"/>-->
<!-- <form-col :span="10" label="是否开启" label-width="5em">-->
<!-- <el-switch v-model="form.showBillMobile" active-text="开启" inactive-text="不开启"/>-->
<!-- </form-col>-->
<!-- <form-col :span="14" label="单价" prop="showBillMobilePrice" v-if="form.showBillMobile">-->
<!-- <el-input v-model="form.showBillMobilePrice" :min="0" type="number" placeholder="请输入单价">-->
<!-- <template #append> / </template>-->
<!-- </el-input>-->
<!-- </form-col>-->
<!-- </el-row>-->
<el-dialog :visible.sync="visible" title="用户配置" width="600px" append-to-body @open="onOpen">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" v-loading="loading">
<!-- 管理员设置 -->
<el-card class="box-card" shadow="never">
<div slot="header">
<span>管理员设置</span>
</div>
<el-form-item label="设备管理员" prop="deviceAdmin">
<el-switch
v-model="form.deviceAdmin"
:active-value="true"
:inactive-value="false"
@change="onChangeDeviceAdmin"
/>
</el-form-item>
</el-card>
<!-- <el-row>-->
<!-- <group-title title="风控配置"/>-->
<!-- <form-col :span="span" label="充值延迟到账" prop="arrivalDelay" label-width="7em">-->
<!-- <el-input v-model="form.arrivalDelay" placeholder="请输入到账延迟时长">-->
<!-- <template #append>小时</template>-->
<!-- </el-input>-->
<!-- </form-col>-->
<!-- </el-row>-->
<!-- <el-row >-->
<!-- <group-title title="代理商配置"/>-->
<!-- <form-col :span="span" label="默认设备服务费" label-width="8em" prop="agentDeviceService">-->
<!-- <el-input v-model="form.agentDeviceService" type="number" :min="0" placeholder="请输入默认设备服务费">-->
<!-- <template #append>%</template>-->
<!-- </el-input>-->
<!-- </form-col>-->
<!-- <form-col :span="span" label="商户开关/充值设备" label-width="10em" prop="agentDeviceService">-->
<!-- <el-switch v-model="form.agentAllowMchSwitch" active-text="允许" inactive-text="不允许"/>-->
<!-- </form-col>-->
<!-- </el-row>-->
<!-- 订单设置 -->
<el-card class="box-card" shadow="never">
<div slot="header">
<span>订单设置</span>
</div>
<el-form-item label="提前开始限制" prop="beforeTime">
<el-input-number
v-model="form.beforeTime"
: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-card>
<el-row>
<group-title title="其他设置"/>
<form-col :span="8" label="是否为设备管理员" label-width="9em" prop="deviceAdmin">
<el-switch v-model="form.deviceAdmin" active-text="" inactive-text="" @change="onChangeDeviceAdmin"/>
</form-col>
</el-row>
<!-- 取消设置 -->
<el-card class="box-card" shadow="never">
<div slot="header">
<span>取消设置</span>
</div>
<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>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :loading="submitLoading"> </el-button>
@ -54,52 +97,60 @@
</template>
<script>
import LineField from '@/components/LineField/index.vue'
import GroupTitle from '@/components/GroupTitle/index.vue'
import { SmUserType } from '@/utils/constants'
import {getUser ,updateUser } from '@/api/user/user';
import { getUser, updateUser } from '@/api/user/user';
export default {
name: "UserConfigDialog",
components: { GroupTitle, LineField },
name: 'UserConfigDialog',
props: {
show: {
type: Boolean,
default: false,
default: false
},
userId: {
type: Number,
default: null,
},
showCurrent: {
type: Boolean,
default: false,
}
},
computed: {
SmUserType() {
return SmUserType
},
visible: {
set(val) {
this.$emit('update:show', val);
},
get() {
return this.show;
}
type: [String, Number],
default: null
}
},
data() {
return {
span: 12,
form: {},
rules: {
showBillMobilePrice: [
{ required: true, message: '请输入单价', trigger: 'blur' }
]
},
visible: false,
loading: 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: {
@ -107,44 +158,32 @@ export default {
if (this.userId != null) {
this.loading = true;
getUser(this.userId).then(response => {
this.form = response.data;
this.form = { ...this.form, ...response.data };
}).finally(() => {
this.loading = false;
})
} else {
this.reset();
}
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs.form.validate(valid => {
if (valid) {
if (this.form.userId != null) {
this.submitLoading = true;
updateUser(this.form).then(res => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit('success');
}).finally(() => {
this.submitLoading = false;
})
}
this.submitLoading = true;
updateUser({
userId: this.userId,
...this.form
}).then(() => {
this.$modal.msgSuccess("修改成功");
this.$emit('success');
this.visible = false;
}).finally(() => {
this.submitLoading = false;
});
}
});
},
//
cancel() {
this.visible = false;
this.reset();
},
//
reset() {
this.form = {
userId: this.userId,
};
this.resetForm("form");
},
//
onChangeDeviceAdmin(val) {
if (val) {
this.$confirm('【高危操作】是否确认设置用户为设备管理员?<br/>用户将可以通过微信小程序注册设备!', {
@ -154,11 +193,92 @@ export default {
dangerouslyUseHTMLString: true
}).then(() => {
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;
});
} 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>
<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>
</el-tab-pane>
<el-tab-pane label="套餐列表" name="rules">
<rule :userId="detail.userId"></rule>
<rule :merchantId="detail.userId"></rule>
</el-tab-pane>
<el-tab-pane label="设施列表" name="equipments">
<equipment :userId="detail.userId"></equipment>
@ -566,7 +566,7 @@ export default {
}
]
};
if (this.dailyChart) {
this.dailyChart.setOption(option);
}
@ -662,7 +662,7 @@ export default {
}
]
};
if (this.monthlyChart) {
this.monthlyChart.setOption(option);
}
@ -715,10 +715,6 @@ export default {
flex: 1;
}
.statistics-cards {
margin-bottom: 20px;
}
.stat-card {
background: #fff;
border-radius: 4px;
@ -851,4 +847,4 @@ export default {
.mb-2 {
margin-bottom: 1rem;
}
</style>
</style>

View File

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