设备管理,设备列表,客户列表功能完善提交

This commit is contained in:
fengerli
2025-07-05 14:30:12 +08:00
parent 1aa9eb23e0
commit 9715c8755d
22 changed files with 633 additions and 326 deletions

View File

@ -91,7 +91,7 @@
<el-row>
<el-col :span="24">
<el-form-item label="客户名称" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入客户名称" maxlength="30" />
<el-input v-model="form.nickName" placeholder="请输入客户名称" />
</el-form-item>
</el-col>
</el-row>
@ -105,14 +105,14 @@
<el-row>
<el-col :span="24">
<el-form-item v-if="form.customerId === ''" label="账号密码" prop="password">
<el-input v-model="form.password" placeholder="请输入账号密码" type="password" maxlength="20" show-password />
<el-input v-model="form.password" placeholder="请输入账号密码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" @click="submitForm" :loading="loadingIng"> </el-button>
<el-button @click="cancel()"> </el-button>
</div>
</template>
@ -137,7 +137,7 @@ const initPassword = ref<string>('');
const queryFormRef = ref<ElFormInstance>();
const userFormRef = ref<ElFormInstance>();
const formDialogRef = ref<ElDialogInstance>();
const loadingIng = ref(false)
const dialog = reactive<DialogOption>({
visible: false,
title: ''
@ -165,6 +165,12 @@ const initData: PageData<UserForm, UserQuery> = {
],
userName: [
{ required: true, message: '请输入客户账号', trigger: 'blur' },
{
min: 2,
max: 20,
message: '客户账号长度必须在 2 和 20 之间',
trigger: 'blur'
}
],
password: [
{ required: true, message: '请输入账号密码', trigger: 'blur' },
@ -285,12 +291,15 @@ const handleUpdate = async (row?: UserForm) => {
/** 提交按钮 */
const submitForm = () => {
userFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
loadingIng.value = true
form.value.customerId ? await api.updateCustomer(form.value) : await api.addCustomer(form.value);
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
loadingIng.value = false
}
});
};