同步6/16
This commit is contained in:
@@ -63,11 +63,6 @@
|
||||
<el-table-column label="巡检任务名称" align="center" prop="taskName" />
|
||||
<el-table-column label="巡检人员" align="center" prop="inspectorName" />
|
||||
<el-table-column label="起止日期" align="center" prop="taskTime" />
|
||||
<el-table-column label="巡检设置" align="center" prop="inspectSetting">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_inspection_plan_setting" :value="scope.row.inspectSetting"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_inspection_task_status" :value="scope.row.status"></dict-tag>
|
||||
@@ -78,7 +73,7 @@
|
||||
<dict-tag :options="com_inspection_remind_tiime" :value="scope.row.remindTime"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="关联巡检计划" align="center" prop="planId" />
|
||||
<el-table-column label="关联巡检计划" align="center" prop="planName" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['system:task:edit']">编辑</el-button>
|
||||
@@ -99,7 +94,6 @@ import { checkPermi } from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_inspection_task_status } = toRefs<any>(proxy?.useDict('com_inspection_task_status'));
|
||||
const { com_inspection_plan_setting } = toRefs<any>(proxy?.useDict('com_inspection_plan_setting'));
|
||||
const { com_inspection_remind_tiime } = toRefs<any>(proxy?.useDict('com_inspection_remind_tiime'));
|
||||
const router = useRouter();
|
||||
const taskList = ref<TaskVO[]>([]);
|
||||
@@ -143,16 +137,14 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询巡检任务列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listTask(queryParams.value);
|
||||
taskList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
listTask(queryParams.value)
|
||||
.then((res) => {
|
||||
taskList.value = res.rows;
|
||||
total.value = res.total;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
@@ -189,27 +181,11 @@ const handleAdd = () => {
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: TaskVO) => {
|
||||
const _ids = row?.id || ids.value[0];
|
||||
router.push({
|
||||
path: '/inspection/editTask',
|
||||
query: {
|
||||
id: row.id
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
taskFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateTask(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addTask(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
id: _ids
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -223,17 +199,6 @@ const handleDelete = async (row?: TaskVO) => {
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'system/task/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`task_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user