员工折扣百分比管理

This commit is contained in:
duan
2024-11-04 15:44:55 +08:00
parent 4b0882bbd4
commit 0d1bde23c3
3 changed files with 35 additions and 24 deletions

View File

@@ -6,14 +6,12 @@
<text style="color: red;">*</text>员工姓名
</view>
<input type="text" v-model="datas.formData.name" placeholder="请填写员工名称" />
<hr />
</view>
<view>
<view>
<text style="color: red;">*</text>手机号
</view>
<input type="text" v-model="datas.formData.phone" placeholder="请填写手机号" />
<hr />
</view>
<view>
@@ -21,7 +19,6 @@
<text style="color: red;">*</text>员工编号
</view>
<input type="text" v-model="datas.formData.code" placeholder="请填写员工编号" />
<hr />
</view>
<view>
@@ -29,14 +26,12 @@
<text style="color: red;">*</text>员工账号
</view>
<input type="text" v-model="datas.formData.account" placeholder="请填写员工账号,建议使用手机号" />
<hr />
</view>
<view>
<view>
登录密码
</view>
<input type="text" v-model="datas.formData.password" placeholder="请输入登录密码不填写默认123456" />
<hr />
</view>
<view>
<view>
@@ -46,21 +41,21 @@
<up-radio label="折扣" name="1"></up-radio>
<up-radio style="margin: 18px 10px;" label="金额" name="0"></up-radio>
</up-radio-group>
<hr />
</view>
<view>
<view>
最低优惠折扣
</view>
<input type="text" v-model="datas.formData.maxDiscountAmount" placeholder="0" />
<hr />
<input v-if="datas.formData.discountType==1" @blur="maxdisinput" type="number"
v-model="datas.formData.maxDiscountAmount" placeholder="请输入最低优惠折扣" />
<input v-if="datas.formData.discountType==0" type="number" v-model="datas.formData.maxDiscountAmount"
placeholder="请输入最低优惠折扣" />
</view>
<view>
<view>
<text style="color: red;">*</text> 角色
</view>
<view @tap="show=true" style="height: 50rpx;font-size: 28rpx;color: #999999;">{{datas.rolesdata }}</view>
<hr />
</view>
</view>
<view class="h7">员工权限设置</view>
@@ -117,7 +112,8 @@
let datas = reactive({
formData: {
permissions: [],
maxDiscountAmount:0
maxDiscountAmount: 0,
discountType:0
},
rolesList: [],
columns: [],
@@ -145,21 +141,22 @@
tbPlussShopStaffDetail(id).then(res => {
datas.formData = res
if (datas.rolesList) {
datas.rolesdata = datas.rolesList.filter(ele => ele.id == res.roleId)[0].name
let rolefilter = datas.rolesList.filter(ele => ele.id == res.roleId)
datas.rolesdata = rolefilter[0].name
}
})
}
function sumbitEvent() {
// 效验
if(!datas.formData.name||!datas.formData.phone||!datas.formData.code||!datas.formData.account){
if (!datas.formData.name || !datas.formData.phone || !datas.formData.code || !datas.formData.account) {
currentInstance.ctx.$refs.uToastRef.show({
message: "请填写必填项",
type: 'default',
})
return
}
let rolesId = datas.rolesList.filter(ele => ele.name == datas.rolesdata)
if (rolesId.length == 0) {
currentInstance.ctx.$refs.message.open()
@@ -187,6 +184,15 @@
})
}
function maxdisinput(d) {
let num = d.detail.value * 1
if (num >= 1) {
datas.formData.maxDiscountAmount = 0.99
}else{
datas.formData.maxDiscountAmount = d.detail.value.substring(0,4)
}
}
function getrolesEvent() {
getroles().then((res) => {
datas.rolesList = res.content
@@ -212,14 +218,13 @@
}
</style>
<style scoped lang="less">
.h7 {
margin: 32rpx 0;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 32rpx;
color: #333333;
width: 400rpx;
}
.content {
@@ -234,6 +239,7 @@
font-weight: bold;
font-size: 28rpx;
color: #333333;
border-bottom: 1px solid #999999;
>input {
padding: 24rpx 0;

View File

@@ -12,14 +12,14 @@
</view>
<view class="">
<view style="display: flex;justify-content: center;align-items: center;">
<span style="font-size: 28rpx;color: #999999;">是否启用</span>
<span style="font-size: 28rpx;color: #999999;">是否启用</span>&nbsp;&nbsp;
<up-switch :activeValue="1" :inactiveValue="0" v-model="item.status" size="18"
@change="switch2Change($event,item)"></up-switch>
</view>
<view class="df">
<up-button size="small" style="border-radius: 28rpx 28rpx 28rpx 28rpx;"
@tap="datas.show = true;datas.rolesId=item.id" text="删除"></up-button>
<up-button type="primary" plain size="small"
<up-button size="small" shape="circle" style="border-radius: 28rpx 28rpx 28rpx 28rpx;"
@tap="datas.show = true;datas.rolesId=item.id" text="删除"></up-button>&nbsp;&nbsp;
<up-button type="primary" shape="circle" plain size="small"
style="border-radius: 28rpx 28rpx 28rpx 28rpx;margin-left: 16rpx;" @tap="toUrl(item)"
text="编辑"></up-button>
</view>

View File

@@ -180,7 +180,7 @@
birthDay: '',
balance: '',
integral: '',
isVip: false,
isVip: true,
level: 1,
sex: 1
})
@@ -202,16 +202,19 @@
onLoad(params => {
console.log(params,'调试111')
if (params.id) {
let items = params
uni.setNavigationBarTitle({
title: '编辑用户'
})
items.phone = items.telephone
items.sex = items.sex == '男' ? 1 : 2
userForm = items
// userForm = items
userForm.nickName=items.nickName
userForm.birthDay=items.birthDay
userForm.id=items.id
userForm.phone = items.telephone
userForm.sex = items.sex == '男' ? 1 : 2
option.type = 'edit'
console.log(userForm,'调试111')
} else {
uni.setNavigationBarTitle({
title: '新增用户'
@@ -236,6 +239,7 @@
status:1,
levelConsume:0,
shopId: uni.getStorageSync("shopId"),
sex:userForm.sex==1?1:2
}
if (res) {
if (option.type == 'add') {
@@ -252,6 +256,7 @@
<style scoped>
page {
background: #F9F9F9;
height: 100vh;
}
</style>
<style lang="scss" scoped>