hejianhao
2025-04-23 10f94693e4bf60c34e5514a1f1e3d44c8ba4d84a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<template>
  <div class="list">
    <TableCustom :queryForm="form" :tableData="tableData" :total="total" :height="null">
      <template #search>
        <el-form :model="form" labelWidth="auto" inline>
          <el-form-item label="所属实验编号:">
            <el-input v-model="form.planCode" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item label="创建人:">
            <el-input v-model="form.creator" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item label="创建时间:">
            <el-date-picker
              v-model="form.createTime"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label="审批人:">
            <el-input v-model="form.approver" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item label="">
            <el-button type="default" @click="resetForm">重置</el-button>
            <el-button type="primary" @click="handleSearch">查询</el-button>
          </el-form-item>
        </el-form>
      </template>
      <template #setting>
        <div class="tableTitle">
          <div class="flex a-center">
            <div class="title active">原始记录检测列表</div>
          </div>
        </div>
      </template>
      <template #table>
        <el-table-column prop="projectPlan" label="所属项目课题方案"></el-table-column>
        <el-table-column prop="experimentNo" label="实验编号"></el-table-column>
        <el-table-column prop="experimentName" label="实验名称"></el-table-column>
        <el-table-column prop="creator" label="创建人"></el-table-column>
        <el-table-column prop="createTime" label="创建时间"></el-table-column>
        <el-table-column prop="status" label="状态">
          <template slot-scope="scope">
            <el-tag :type="scope.row.status === '已填写' ? 'success' : 'warning'">
              {{ scope.row.status }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="150">
          <template slot-scope="scope">
            <el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
            <el-button type="text" @click="handleDetail(scope.row.id)">详情</el-button>
          </template>
        </el-table-column>
      </template>
    </TableCustom>
  </div>
</template>
 
<script>
export default {
  name: "OriginalRecordTest",
  data() {
    return {
      form: {
        planCode: "",
        creator: "",
        createTime: [],
        approver: ""
      },
      tableData: [
        {
          id: '1',
          projectPlan: 'DD250218-JL01',
          experimentNo: '31423764',
          experimentName: '化学成分分析实验',
          creator: '张三',
          createTime: '2025-1-8 17:56:11',
          status: '未填写'
        },
        {
          id: '2',
          projectPlan: 'DD250218-JL02',
          experimentNo: '31423765',
          experimentName: '物理性能测试实验',
          creator: '李四',
          createTime: '2025-1-8 18:00:00',
          status: '未填写'
        },
        {
          id: '3',
          projectPlan: 'DD250218-JL03',
          experimentNo: '31423766',
          experimentName: '材料强度测试',
          creator: '王五',
          createTime: '2025-1-8 18:30:00',
          status: '已填写'
        },
        {
          id: '4',
          projectPlan: 'DD250218-JL04',
          experimentNo: '31423767',
          experimentName: '耐久性测试实验',
          creator: '赵六',
          createTime: '2025-1-8 19:00:00',
          status: '已填写'
        },
        {
          id: '5',
          projectPlan: 'DD250218-JL05',
          experimentNo: '31423768',
          experimentName: '环境适应性测试',
          creator: '孙七',
          createTime: '2025-1-8 19:30:00',
          status: '未填写'
        }
      ],
      total: 5
    };
  },
  created() {
    this.getTableData();
  },
  methods: {
    resetForm() {
      this.form = {
        planCode: "",
        creator: "",
        createTime: [],
        approver: ""
      };
    },
    handleSearch() {
      this.getTableData();
    },
    handleEdit(row) {
      console.log("编辑数据:", row);
    },
    handleDetail(id) {
      this.$router.push({
        path: "/dataManagement/originalRecordTest/detail",
        query: { id }
      });
    },
    getTableData() {
      // TODO: 调用接口获取数据
    //   this.tableData = [];
    //   this.total = 0;
    }
  }
};
</script>
 
<style scoped lang="less">
.list {
  height: 100%;
}
.flex {
  display: flex;
  align-items: center;
}
.tableTitle {
  display: flex;
  padding-bottom: 20px;
  justify-content: space-between;
  align-items: center;
  .title {
    background: #fafafc;
    border-radius: 8px 8px 0px 0px;
    border: 1px solid #dcdfe6;
    padding: 16px 29px;
    font-weight: bold;
    font-size: 18px;
    color: #606266;
    width: unset;
  }
  .active {
    color: #049c9a;
    background: #ffffff;
    border-radius: 8px 8px 0px 0px;
    border: 1px solid #049c9a;
  }
}
</style>