gaoluyang
2025-07-01 049dd638c4de83fd8415c258c29d9ef71fd58141
src/views/inspectionManagement/index.vue
@@ -1,18 +1,10 @@
<template>
  <div class="app-container">
    <el-form :inline="true" :model="queryParams" class="search-form">
      <el-form-item label="时间">
      <el-form-item label="搜索">
        <el-input
            v-model="queryParams.supplierName"
            placeholder="请输入"
            clearable
            :style="{ width: '100%' }"
        />
      </el-form-item>
      <el-form-item label="设备名称">
        <el-input
            v-model="queryParams.coal"
            placeholder="请输入"
            v-model="queryParams.searchAll"
            placeholder="请输入关键字"
            clearable
            :style="{ width: '100%' }"
        />
@@ -45,7 +37,7 @@
        </el-radio-group>
        <!-- 操作按钮区 -->
        <el-space v-if="activeRadio !== 'task'">
          <el-button type="primary" :icon="Plus" @click="handleAdd">新建</el-button>
          <el-button type="primary" :icon="Plus" @click="handleAdd(undefined)">新建</el-button>
          <el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button>
          <!-- <el-button type="info" plain :icon="Download">导出</el-button> -->
        </el-space>
@@ -127,8 +119,7 @@
const viewQrCodeFiles = ref()
// 查询参数
const queryParams = reactive({
  supplierName: "",
  coal: "",
  searchAll: "",
})
// 当前标签
const activeTab = ref("task");
@@ -156,11 +147,22 @@
const pageSize = ref(10);
const columns = ref([
  { prop: "taskName", label: "巡检任务名称", minWidth: 160 },
  { prop: "port", label: "地点", minWidth: 120 },
  { prop: "inspectionLocation", label: "地点", minWidth: 120 },
  { prop: "remarks", label: "备注", minWidth: 150 },
  { prop: "inspector", label: "执行巡检人", minWidth: 150 },
  { prop: "inspector", label: "频次", minWidth: 150 },
  { prop: "inspector", label: "开始日期", minWidth: 150 },
  { prop: "frequencyType", label: "频次", minWidth: 150,
    formatter: (row, column, cellValue) => {
    if (cellValue === 'DAILY') {
      return '每日';
    } else if (cellValue === 'MONTHLY') {
      return '每月';
    } else if (cellValue === 'WEEKLY') {
      return '每周';
    } else {
      return '季度'
    }
    }},
  { prop: "frequencyDetail", label: "开始日期与时间", minWidth: 150 },
  { prop: "registrant", label: "登记人", minWidth: 100 },
  { prop: "createTime", label: "登记日期", minWidth: 100 },
]);
@@ -181,12 +183,15 @@
  getList();
};
const radioChange = (value) => {
  if (value !== "task") {
  if (value === "taskManage") {
    tableColumns.value = columns.value;
    operationsArr.value = ['edit']
  } else if (value === "task") {
    tableColumns.value = columns.value;
    operationsArr.value = ['viewFile']
  } else {
    tableColumns.value = columns1.value;
    operationsArr.value = ['viewFile']
    operationsArr.value = ['edit']
  }
  getList();
}
@@ -240,6 +245,7 @@
// 新增、编辑
const handleAdd = (row) => {
  console.log(row)
  const type = row === undefined ? 'add' : 'edit'
  nextTick(() => {
    if (tabName.value === 'task') {