添加修改SN号数量功能

This commit is contained in:
2026-06-11 13:15:46 +08:00
parent 6cfd4e1a2a
commit b4915babf2
2 changed files with 32 additions and 1 deletions

View File

@@ -180,6 +180,8 @@ export default {
searchAllocationSN: "/accountManager/searchAllocationSN",
// 搜索可分配的单位用户
searchAllocationUser: "/accountManager/searchAllocationUser",
// 修改可管理的SN号数量
editSNCount: "/accountManager/editSNCount",
// B端分配SN号
allocationSN: "/accountManager/allocationSN",
// 查看B端SN号分配记录

View File

@@ -43,7 +43,7 @@
>
<div class="sn-count-label">
用户可管理的SN号数量
<div>
<div class="flex justify-center">
<el-input
v-model.number="snCount"
type="number"
@@ -52,6 +52,9 @@
:min="0"
@change="validateSNCount"
/>
<el-button type="primary" @click="editSNCount">
修改
</el-button>
</div>
<el-button class="bind-button" type="primary" @click="allocationSN">
确认{{ mode ? "绑定" : "解绑" }}
@@ -227,6 +230,32 @@ const searchAllocationSN = () => {
});
};
const editSNCount = () => {
if (selectedUser.value === "") {
ElMessage.warning("请选择用户!");
return;
}
const data = {
user_uid: userObj.value[selectedUser.value].uid,
length: snCount.value
};
$http.post($url.editSNCount, data).then((res) => {
if (res.data.code === 200) {
resetCheckForm();
usersArr.value = [];
SNArr.value = [];
searchAllocationUser();
searchAllocationSN();
ElMessage({
message: "修改成功!",
type: "success",
});
} else {
ElMessage.error("修改失败!");
}
});
};
const allocationSN = () => {
if (
selectedUser.value === "" ||