lishenao
10 天以前 fde27654b1b21a8d2c149d3d12f86c3c7314c091
src/views/equipmentManagement/repair/index.vue
@@ -15,14 +15,14 @@
          <el-button type="success" icon="Van" @click="addRepair">
            新增报修
          </el-button>
          <!-- <el-button
          <el-button
            type="danger"
            icon="Delete"
            :disabled="multipleList.length <= 0"
            @click="delRepairByIds(multipleList.map((item) => item.id))"
          >
            批量删除
          </el-button> -->
          </el-button>
        </div>
      </div>
      <PIMTable
@@ -36,6 +36,7 @@
          total: pagination.total,
        }"
        @selection-change="handleSelectionChange"
        @pagination="changePage"
      >
        <template #statusRef="{ row }">
          <el-tag v-if="row.status === 1" type="success">完结</el-tag>
@@ -87,72 +88,79 @@
const multipleList = ref([]);
// 表格钩子
const { filters, columns, dataList, pagination, getTableData, resetFilters } =
  usePaginationApi(
    getRepairPage,
const {
  filters,
  columns,
  dataList,
  pagination,
  getTableData,
  resetFilters,
  onCurrentChange,
} = usePaginationApi(
  getRepairPage,
  {
    searchText: undefined,
  },
  [
    {
      searchText: undefined,
      label: "设备名称",
      align: "center",
      prop: "deviceName",
    },
    [
      {
        label: "设备名称",
        align: "center",
        prop: "deviceName",
      },
      {
        label: "规格型号",
        align: "center",
        prop: "deviceModel",
      },
      {
        label: "报修日期",
        align: "center",
        prop: "repairTime",
        formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"),
      },
      {
        label: "报修人",
        align: "center",
        prop: "repairName",
      },
      {
        label: "故障现象",
        align: "center",
        prop: "remark",
      },
      {
        label: "维修人",
        align: "center",
        prop: "maintenanceName",
      },
      {
        label: "维修结果",
        align: "center",
        prop: "maintenanceResult",
      },
      {
        label: "维修日期",
        align: "center",
        prop: "maintenanceTime",
        formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
      },
      {
        label: "状态",
        align: "center",
        prop: "status",
        dataType: "slot",
        slot: "statusRef",
      },
      {
        fixed: "right",
        label: "操作",
        dataType: "slot",
        slot: "operation",
        align: "center",
        width: "200px",
      },
    ]
  );
    {
      label: "规格型号",
      align: "center",
      prop: "deviceModel",
    },
    {
      label: "报修日期",
      align: "center",
      prop: "repairTime",
      formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"),
    },
    {
      label: "报修人",
      align: "center",
      prop: "repairName",
    },
    {
      label: "故障现象",
      align: "center",
      prop: "remark",
    },
    {
      label: "维修人",
      align: "center",
      prop: "maintenanceName",
    },
    {
      label: "维修结果",
      align: "center",
      prop: "maintenanceResult",
    },
    {
      label: "维修日期",
      align: "center",
      prop: "maintenanceTime",
      formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
    },
    {
      label: "状态",
      align: "center",
      prop: "status",
      dataType: "slot",
      slot: "statusRef",
    },
    {
      fixed: "right",
      label: "操作",
      dataType: "slot",
      slot: "operation",
      align: "center",
      width: "200px",
    },
  ]
);
// 多选后做什么
const handleSelectionChange = (selectionList) => {
@@ -161,7 +169,7 @@
// 新增报修
const addRepair = () => {
  repairModalRef.value.openModal();
  repairModalRef.value.openAdd();
};
// 编辑报修
@@ -175,6 +183,11 @@
  maintainModalRef.value.open(row.id, row);
};
const changePage = ({ page }) => {
  pagination.currentPage = page;
  onCurrentChange(page);
};
// 单行删除
const delRepairByIds = async (ids) => {
  ElMessageBox.confirm("确认删除报修数据, 此操作不可逆?", "警告", {