|
@@ -0,0 +1,334 @@
|
|
|
+<template>
|
|
|
+ <div class="table_item">
|
|
|
+ <s-table ref="tableRef" :columns="columns" :data="loadData" :row-key="(record) => record.code">
|
|
|
+ <template #operator>
|
|
|
+ <!-- 搜索区域 -->
|
|
|
+ <div class="table-search">
|
|
|
+ <div class="table-search-form">
|
|
|
+ <a-row :gutter="10">
|
|
|
+ <a-form
|
|
|
+ ref="searchFormRef"
|
|
|
+ name="advanced_search"
|
|
|
+ layout="inline"
|
|
|
+ :label-col="{ style: { width: '70px', justifyContent: 'end' } }"
|
|
|
+ :model="searchFormState"
|
|
|
+ class="ant-advanced-search-form"
|
|
|
+ >
|
|
|
+ <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8"
|
|
|
+ ><a-form-item label="对象编号" name="dxcode">
|
|
|
+ <a-input v-model:value="searchFormState.dxcode" placeholder="请输入对象编号" /> </a-form-item
|
|
|
+ ></a-col>
|
|
|
+ <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8"
|
|
|
+ ><a-form-item label="对象名称" name="name">
|
|
|
+ <a-input v-model:value="searchFormState.name" placeholder="请输入对象名称" /> </a-form-item
|
|
|
+ ></a-col>
|
|
|
+ </a-form>
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
+ <div class="table-search-buttons">
|
|
|
+ <a-button type="primary" @click="tableRef.refresh(true)">查询</a-button>
|
|
|
+ <a-button class="xn-mg08" @click="reset">重置</a-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 其他操作区域 -->
|
|
|
+ <div class="table-head-btn">
|
|
|
+ <div class="btn-left">
|
|
|
+ <a-button type="primary">
|
|
|
+ <template #icon><plus-outlined /></template>新增
|
|
|
+ </a-button>
|
|
|
+ </div>
|
|
|
+ <div class="btn-right">
|
|
|
+ <a-button>
|
|
|
+ <template #icon><download-outlined /></template>导出
|
|
|
+ </a-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #bodyCell="{ column, record }">
|
|
|
+ <template v-if="column.dataIndex === 'sfxf'">
|
|
|
+ <span>
|
|
|
+ <a-tag :color="record.sfxf == '1' ? '#87d068' : '#cd201f'">
|
|
|
+ {{ record.sfxf == '1' ? '是' : '否' }}
|
|
|
+ </a-tag>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'action'">
|
|
|
+ <a-button type="link" size="small">编辑</a-button>
|
|
|
+ <a-popconfirm title="确定要删除吗?" @confirm="deleteData(record)">
|
|
|
+ <a-button type="link" danger size="small">删除</a-button>
|
|
|
+ </a-popconfirm>
|
|
|
+ <a-button type="link" size="small">记录</a-button>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+ import tool from '@/utils/tool'
|
|
|
+ import jobApi from '@/api/dev/jobApi'
|
|
|
+ const searchFormRef = ref()
|
|
|
+ const searchFormState = ref({})
|
|
|
+ const tableRef = ref()
|
|
|
+ const columns = [
|
|
|
+ {
|
|
|
+ title: '对象编号',
|
|
|
+ dataIndex: 'code',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '对象名称',
|
|
|
+ dataIndex: 'name',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '品牌',
|
|
|
+ dataIndex: 'pp',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '规则型号',
|
|
|
+ dataIndex: 'gzxh',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所处位置',
|
|
|
+ dataIndex: 'scwz',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '损坏日期',
|
|
|
+ dataIndex: 'shrq',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '维修日期',
|
|
|
+ dataIndex: 'wxrq',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '维修人',
|
|
|
+ dataIndex: 'wxr',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '故障描述',
|
|
|
+ dataIndex: 'gzms',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '维修后情况',
|
|
|
+ dataIndex: 'wxhqk',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '是否修复',
|
|
|
+ dataIndex: 'sfxf',
|
|
|
+ align: 'center',
|
|
|
+ ellipsis: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'action',
|
|
|
+ align: 'center',
|
|
|
+ width: 150
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ const loadData = (parameter) => {
|
|
|
+ return jobApi.jobPage(Object.assign(parameter, searchFormState.value)).then((res) => {
|
|
|
+ // return res
|
|
|
+ const obj = {
|
|
|
+ current: 1,
|
|
|
+ pages: 1,
|
|
|
+ records: [
|
|
|
+ {
|
|
|
+ code: 'Y6578945621',
|
|
|
+ name: 'ABSL-3超低温冰箱123456',
|
|
|
+ pp: '海尔',
|
|
|
+ gzxh: 'HEGZXH-202411120920',
|
|
|
+ scwz: '实验室一号楼301室',
|
|
|
+ shrq: '2024-09-28 07:03:24',
|
|
|
+ wxrq: '2024-09-30 11:51:02',
|
|
|
+ wxr: '欧阳天添',
|
|
|
+ gzms: '故障描述故障描述故障描述故障描述故障描述',
|
|
|
+ wxhqk: '正常',
|
|
|
+ sfxf: '是',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ code: 'Y6578945621-01',
|
|
|
+ name: 'ABSL-3超低温冰箱123456-01',
|
|
|
+ pp: '海尔-01',
|
|
|
+ gzxh: 'HEGZXH-202411120920-01',
|
|
|
+ scwz: '实验室一号楼301室-01',
|
|
|
+ shrq: '2024-09-29 09:13:24',
|
|
|
+ wxrq: '2024-09-30 19:11:32',
|
|
|
+ wxr: '欧阳天添',
|
|
|
+ gzms: '故障描述故障描述故障描述故障描述故障描述-01',
|
|
|
+ wxhqk: '正常',
|
|
|
+ sfxf: '是'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'Y6578945622',
|
|
|
+ name: 'ABSL-3超低温冰箱2',
|
|
|
+ pp: '海尔',
|
|
|
+ gzxh: 'HEGZXH-202411120922',
|
|
|
+ scwz: '实验室一号楼302室',
|
|
|
+ shrq: '2024-09-28 07:03:24',
|
|
|
+ wxrq: '2024-09-30 11:51:02',
|
|
|
+ wxr: '欧阳天添',
|
|
|
+ gzms: '故障描述故障描述故障描述故障描述故障描述',
|
|
|
+ wxhqk: '正常',
|
|
|
+ sfxf: '是',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ code: 'Y6578945622-01',
|
|
|
+ name: 'ABSL-3超低温冰箱2-01',
|
|
|
+ pp: '海尔',
|
|
|
+ gzxh: 'HEGZXH-202411120922-01',
|
|
|
+ scwz: '实验室一号楼302室-01',
|
|
|
+ shrq: '2024-09-28 07:03:24',
|
|
|
+ wxrq: '2024-09-30 11:51:02',
|
|
|
+ wxr: '欧阳天添',
|
|
|
+ gzms: '故障描述故障描述故障描述故障描述故障描述',
|
|
|
+ wxhqk: '正常',
|
|
|
+ sfxf: '是'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'Y6578945623',
|
|
|
+ name: 'ABSL-3超低温冰箱3',
|
|
|
+ pp: '海尔',
|
|
|
+ gzxh: 'HEGZXH-202411120923',
|
|
|
+ scwz: '实验室一号楼303室',
|
|
|
+ shrq: '2024-09-28 07:03:24',
|
|
|
+ wxrq: '2024-09-30 11:51:02',
|
|
|
+ wxr: '欧阳天添',
|
|
|
+ gzms: '故障描述故障描述故障描述故障描述故障描述',
|
|
|
+ wxhqk: '正常',
|
|
|
+ sfxf: '是',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ code: 'Y6578945623-01',
|
|
|
+ name: 'ABSL-3超低温冰箱3-01',
|
|
|
+ pp: '海尔',
|
|
|
+ gzxh: 'HEGZXH-202411120923-01',
|
|
|
+ scwz: '实验室一号楼303室-01',
|
|
|
+ shrq: '2024-09-28 07:03:24',
|
|
|
+ wxrq: '2024-09-30 11:51:02',
|
|
|
+ wxr: '欧阳天添',
|
|
|
+ gzms: '故障描述故障描述故障描述故障描述故障描述',
|
|
|
+ wxhqk: '正常',
|
|
|
+ sfxf: '是'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'Y6578945624',
|
|
|
+ name: 'ABSL-3超低温冰箱4',
|
|
|
+ pp: '海尔',
|
|
|
+ gzxh: 'HEGZXH-202411120924',
|
|
|
+ scwz: '实验室一号楼304室',
|
|
|
+ shrq: '2024-09-28 07:03:24',
|
|
|
+ wxrq: '2024-09-30 11:51:02',
|
|
|
+ wxr: '欧阳天添',
|
|
|
+ gzms: '故障描述故障描述故障描述故障描述故障描述',
|
|
|
+ wxhqk: '正常',
|
|
|
+ sfxf: '是',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ code: 'Y6578945624-01',
|
|
|
+ name: 'ABSL-3超低温冰箱4-01',
|
|
|
+ pp: '海尔',
|
|
|
+ gzxh: 'HEGZXH-202411120924-01',
|
|
|
+ scwz: '实验室一号楼304室-01',
|
|
|
+ shrq: '2024-09-28 07:03:24',
|
|
|
+ wxrq: '2024-09-30 11:51:02',
|
|
|
+ wxr: '欧阳天添',
|
|
|
+ gzms: '故障描述故障描述故障描述故障描述故障描述',
|
|
|
+ wxhqk: '正常',
|
|
|
+ sfxf: '是'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'Y6578945625',
|
|
|
+ name: 'ABSL-3超低温冰箱5',
|
|
|
+ pp: '海尔',
|
|
|
+ gzxh: 'HEGZXH-202411120925',
|
|
|
+ scwz: '实验室一号楼305室',
|
|
|
+ shrq: '2024-09-28 07:03:24',
|
|
|
+ wxrq: '2024-09-30 11:51:02',
|
|
|
+ wxr: '欧阳天添',
|
|
|
+ gzms: '故障描述故障描述故障描述故障描述故障描述',
|
|
|
+ wxhqk: '正常',
|
|
|
+ sfxf: '是',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ code: 'Y6578945625-01',
|
|
|
+ name: 'ABSL-3超低温冰箱5-01',
|
|
|
+ pp: '海尔',
|
|
|
+ gzxh: 'HEGZXH-202411120925-01',
|
|
|
+ scwz: '实验室一号楼305室-01',
|
|
|
+ shrq: '2024-09-28 07:03:24',
|
|
|
+ wxrq: '2024-09-30 11:51:02',
|
|
|
+ wxr: '欧阳天添',
|
|
|
+ gzms: '故障描述故障描述故障描述故障描述故障描述',
|
|
|
+ wxhqk: '正常',
|
|
|
+ sfxf: '是'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: 'Y6578945626',
|
|
|
+ name: 'ABSL-3超低温冰箱6',
|
|
|
+ pp: '海尔',
|
|
|
+ gzxh: 'HEGZXH-202411120926',
|
|
|
+ scwz: '实验室一号楼306室',
|
|
|
+ shrq: '2024-09-28 07:03:24',
|
|
|
+ wxrq: '2024-09-30 11:51:02',
|
|
|
+ wxr: '欧阳天添',
|
|
|
+ gzms: '故障描述故障描述故障描述故障描述故障描述',
|
|
|
+ wxhqk: '正常',
|
|
|
+ sfxf: '是'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ size: 10,
|
|
|
+ total: 6
|
|
|
+ }
|
|
|
+ return obj
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 重置
|
|
|
+ const reset = () => {
|
|
|
+ searchFormRef.value.resetFields()
|
|
|
+ tableRef.value.refresh(true)
|
|
|
+ }
|
|
|
+ // 删除
|
|
|
+ const deleteData = (record) => {
|
|
|
+ console.log(record, '删除')
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+ .table_item {
|
|
|
+ padding: 15px 20px;
|
|
|
+ :deep(.ant-table-pagination-right) {
|
|
|
+ justify-content: center !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|