8/25 dev bug
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<el-form class="formBody" label-position="right" ref="formRef" :model="form" :rules="rules" label-width="130px">
|
||||
<el-form-item label="设备分类" prop="categoryId">
|
||||
<el-select v-model="form.categoryId">
|
||||
<el-option v-for="(item, index) in deviceCategorylist" :key="index" :value="item.id" :label="item.categoryName"></el-option>
|
||||
<el-option v-for="(item, index) in deviceCategoryList" :key="index" :value="item.id" :label="item.categoryName"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
@@ -25,7 +25,7 @@
|
||||
<el-form-item label="维护人员" prop="maintainUserIds">
|
||||
<repairUser
|
||||
userType="repair"
|
||||
:userid="checkoutuseid"
|
||||
:userid="checkoutUseId"
|
||||
ref="repairUserRef"
|
||||
returnvalue="*"
|
||||
:is-multiple="true"
|
||||
@@ -33,7 +33,7 @@
|
||||
@change="handleCheckoutUser"
|
||||
>
|
||||
<template #default>
|
||||
<div class="checkoutuserbox flex flex-items-center justify-around" v-for="(item, index) in checkoutuser" :key="index">
|
||||
<div class="checkoutUserBox flex flex-items-center justify-around" v-for="(item, index) in checkoutUser" :key="index">
|
||||
<span>{{ item.nickName }}</span>
|
||||
<div @click="handleDelete(item.id)">
|
||||
<el-icon>
|
||||
@@ -41,7 +41,7 @@
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="checkoutuserbox add flex flex-items-center justify-center" @click="() => repairUserRef.open()">
|
||||
<div class="checkoutUserBox add flex flex-items-center justify-center" @click="() => repairUserRef.open()">
|
||||
<el-icon>
|
||||
<Plus></Plus>
|
||||
</el-icon>
|
||||
@@ -106,10 +106,10 @@ const rules = ref({
|
||||
});
|
||||
const userid = ref(null);
|
||||
|
||||
const deviceCategorylist = ref([]);
|
||||
const deviceCategoryList = ref([]);
|
||||
function init() {
|
||||
listDeviceCategory().then((res) => {
|
||||
deviceCategorylist.value = res.rows;
|
||||
deviceCategoryList.value = res.rows;
|
||||
});
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
@@ -127,33 +127,33 @@ function init() {
|
||||
remark: res.data.remark
|
||||
};
|
||||
|
||||
checkoutuser.value = [];
|
||||
checkoutuser.value = res.data.maintainUserList;
|
||||
checkoutUser.value = [];
|
||||
checkoutUser.value = res.data.maintainUserList ?? [];
|
||||
});
|
||||
}
|
||||
}
|
||||
init();
|
||||
|
||||
const checkoutuseid = computed(() => {
|
||||
return checkoutuser.value
|
||||
const checkoutUseId = computed(() => {
|
||||
return checkoutUser.value
|
||||
.map((item) => item.userId)
|
||||
.filter((item) => item)
|
||||
.join(',');
|
||||
});
|
||||
const checkoutuser = ref([]);
|
||||
function handleCheckoutUser(row) {
|
||||
checkoutuser.value = row;
|
||||
const checkoutUser = ref([]);
|
||||
function handleCheckoutUser(row: string[]) {
|
||||
checkoutUser.value = row;
|
||||
}
|
||||
|
||||
function handleDelete(id: string) {
|
||||
checkoutuser.value = checkoutuser.value.filter((item) => item.id !== id);
|
||||
checkoutUser.value = checkoutUser.value.filter((item) => item.id !== id);
|
||||
}
|
||||
|
||||
// !== 提交 =============================================================================
|
||||
// 提交
|
||||
const submitForm = () => {
|
||||
form.value.maintainUserIds = checkoutuser.value
|
||||
.map((itme) => itme.userId)
|
||||
form.value.maintainUserIds = checkoutUser.value
|
||||
.map((item) => item.userId)
|
||||
.filter((item) => item)
|
||||
.join(',');
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
@@ -205,7 +205,7 @@ const cancelForm = () => {
|
||||
width: 650px;
|
||||
margin: 0 auto;
|
||||
|
||||
.checkoutuserbox {
|
||||
.checkoutUserBox {
|
||||
width: 120px;
|
||||
margin: 5px;
|
||||
border: 1px solid #ccc;
|
||||
|
||||
Reference in New Issue
Block a user