This commit is contained in:
duan 2024-11-22 10:07:57 +08:00
commit ef5f3e1fe5
2 changed files with 17 additions and 15 deletions

View File

@ -100,7 +100,7 @@ export function updateStatus(data) {
// 编辑
export function tbPlussShopStaffDetail(id) {
return request({
url: `/api/tbPlussShopStaff/${id}`,
url: `/api/tbPlussShopStaff/` + id,
method: "get"
});
}

View File

@ -89,7 +89,7 @@
<script setup>
import {
getCurrentInstance,
reactive,
ref
} from 'vue';
@ -116,7 +116,7 @@
formData: {
permissions: [],
maxDiscountAmount: 0,
discountType:0
discountType: 0
},
rolesList: [],
columns: [],
@ -129,24 +129,17 @@
onShow(() => {
//
getrolesEvent()
if (props.type == 'add') {
getList()
} else {
// id
gettbPlussShopStaffDetail(props.id)
uni.setNavigationBarTitle({
title: '编辑员工'
})
}
})
function gettbPlussShopStaffDetail(id) {
tbPlussShopStaffDetail(id).then(res => {
console.log(res,'编辑员工后的提示')
datas.formData = res
if (datas.rolesList) {
let rolefilter = datas.rolesList.filter(ele => ele.id == res.roleId)
datas.rolesdata = rolefilter[0].name
console.log(res, '编辑员工后的提示')
}
})
}
@ -192,8 +185,8 @@
let num = d.detail.value * 1
if (num >= 1) {
datas.formData.maxDiscountAmount = 0.99
}else{
datas.formData.maxDiscountAmount = d.detail.value.substring(0,4)
} else {
datas.formData.maxDiscountAmount = d.detail.value.substring(0, 4)
}
}
@ -203,6 +196,15 @@
res.content.forEach(ele => {
columns[0].push(ele.name)
})
if (props.type == 'add') {
getList()
} else {
uni.setNavigationBarTitle({
title: '编辑员工'
})
// id
gettbPlussShopStaffDetail(props.id)
}
})
}