8/25 dev bug
This commit is contained in:
@@ -38,10 +38,15 @@
|
||||
:show-add="checkPermi(['repair:repair:add'])"
|
||||
:show-edit="checkPermi(['repair:repair:edit'])"
|
||||
:show-delete="checkPermi(['repair:repair:remove'])"
|
||||
add-title="个人报修"
|
||||
@update:add="handleAdd"
|
||||
@update:edit="handleUpdate()"
|
||||
@update:delete="handleDelete()"
|
||||
></right-toolbar>
|
||||
>
|
||||
<template #actions>
|
||||
<el-button type="default" icon="Plus" v-hasPermi="['repair:repair:add']" @click="handleAdd('public')">公共报修</el-button>
|
||||
</template>
|
||||
</right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
@@ -77,7 +82,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
</div>
|
||||
@@ -190,19 +194,40 @@ const handleSelectionChange = (selection: RepairVO[]) => {
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
const handleAdd = (type: 'public' | 'private' = 'private') => {
|
||||
router.push({
|
||||
path: '/repair/addRepair'
|
||||
path: '/repair/addRepair',
|
||||
query: {
|
||||
type
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = (row?: RepairVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
let type: string;
|
||||
// 如果有行数据,根据houseId判断类型
|
||||
if (row) {
|
||||
if (row.houseId) {
|
||||
type = 'private';
|
||||
} else {
|
||||
type = 'public';
|
||||
}
|
||||
} else {
|
||||
// 多选编辑时,根据第一个选中的行判断类型
|
||||
const item = repairList.value.find((item) => item.id === _id);
|
||||
if (item) {
|
||||
type = item.houseId ? 'private' : 'public';
|
||||
} else {
|
||||
type = 'private';
|
||||
}
|
||||
}
|
||||
router.push({
|
||||
path: '/repair/editRepair',
|
||||
query: {
|
||||
id: _id
|
||||
id: _id,
|
||||
type
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user