hdy
2024-07-10 a4362dfe3e0e9c6fad426685da0065455799d018
提交 | 用户 | 时间
0cceb6 1 <template>
Y 2   <div class="app-container">
3     <el-card class="box-card" >
4       <el-form :model="queryParams" ref="queryForm" :inline="true"  v-show="showSearch" label-width="68px" >
5         <el-form-item label-width="120" label="箱体编码:" prop="sfcCode">
6           <el-input clearable
7                     v-model="queryParams.sfcCode"
8                     placeholder="请输入箱体编码"
9                     @keyup.enter.native="handleQuery"/>
10         </el-form-item>
11         <el-form-item label-width="120" label="工位号:" prop="locationCode">
12           <el-input clearable
13                     v-model="queryParams.locationCode"
14                     placeholder="请输入工位号"
15                     @keyup.enter.native="handleQuery"/>
16         </el-form-item>
17         <el-form-item label-width="130" label="保存日期" prop="dateConditions">
18           <el-date-picker
19             v-model="queryParams.dateConditions"
20             type="datetimerange"
21             :picker-options="pickerOptions"
22             value-format="yyyy-MM-dd HH:mm:ss"
23             range-separator="至"
24             start-placeholder="开始日期"
25             end-placeholder="结束日期"
26             align="right">
27           </el-date-picker>
28         </el-form-item>
29         <el-form-item style="float: right">
30           <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button>
31           <el-button type=""    icon="el-icon-refresh"  @click="resetQuery">重置</el-button>
32         </el-form-item>
33       </el-form>
34     </el-card> <el-card style="margin-top: 10px" class="box-card">
35     <el-table v-loading="loading" border :data="detectionReportList" @selection-change="handleSelectionChange" v-if="detectionReportList.length > 0">
36       <el-table-column type="selection" width="55" align="center" />
37       <el-table-column label="箱体编码" align="center" width="200" prop="sfcCode"></el-table-column>
38       <el-table-column label="工位" align="center" prop="locationCode"></el-table-column>
39       <el-table-column label="参数编码" align="center" prop="paramCode"></el-table-column>
40       <el-table-column label="参数名称" align="center" prop="paramName"></el-table-column>
41       <el-table-column label="参数值" align="center" prop="paramValue"></el-table-column>
42       <el-table-column label="采集时间" align="center" prop="collectionTime" width="180">
43         <template slot-scope="scope">
44           <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
45         </template>
46       </el-table-column>
47       <el-table-column label="状态" align="center" prop="state"></el-table-column>
48       <el-table-column label="单位" align="center" prop="unit"></el-table-column>
49     </el-table>
50     <el-empty v-else>
51       <span slot="description">暂无数据</span>
52     </el-empty>
53   </el-card>
54
55     <pagination
56       v-show="total>0"
57       :total="total"
58       :page.sync="queryParams.pageNum"
59       :limit.sync="queryParams.pageSize"
60       @pagination="getList"
61     />
62
63   </div>
64 </template>
65 <script>
66
67 import { listParamCollection, getParamCollection, delParamCollection, addParamCollection, updateParamCollection } from "@/api/main/da/paramCollection/paramCollection";
68
69 export default {
70   name: "detection",
71   computed: {
72   },
73   dicts: ['sys_normal_disable','order_scheduling_produce_status','print_status'],
74   components: {
75   },
76   data(){
77     return{
78       dateRange: '',
79       // 用于存储选择的日期范围
80       total: 0,
81       ids: [],
82       detectionReportList: [],
83       loading: true,
84       single: true,
85       // 非多个禁用
86       multiple: true,
87       // 显示搜索条件
88       showSearch: true,
89       // 查询参数
90       queryParams: {
91         pageNum: 1,
92         pageSize: 10,
93         workOrderNo: null,
94         sfcCode: null,
95         productCode: null,
96         productionLine: null,
97         locationCode: null,
98         equipmentNo: null,
99         paramCode: null,
100         paramValue: null,
101         paramUpper: null,
102         paramLower: null,
103         paramStandard: null,
104         collectionTime: null,
105         spareField1: null,
106         spareField2: null,
107         createUser: null,
108         createTime: null,
109         updateUser: null,
110         updateTime: null,
111         state: null,
112         paramName: null,
113         unit: null,
114         type: '外漏检测',
115         startDate: null,
116         endDate: null,
117         dateConditions: [],
118       },
119       pickerOptions: {
120         shortcuts: [{
121           text: '最近一周',
122           onClick(picker) {
123             const end = new Date();
124             const start = new Date();
125             start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
126             picker.$emit('pick', [start, end]);
127           }
128         }, {
129           text: '最近一个月',
130           onClick(picker) {
131             const end = new Date();
132             const start = new Date();
133             start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
134             picker.$emit('pick', [start, end]);
135           }
136         }, {
137           text: '最近三个月',
138           onClick(picker) {
139             const end = new Date();
140             const start = new Date();
141             start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
142             picker.$emit('pick', [start, end]);
143           }
144         }]
145       },
146     }
147   },
148   created() {
149     this.getList();
150   },
151   methods: {
152     reset() {
153       this.form = {
154         id: null,
155         workOrderNo: null,
156         sfcCode: null,
157         productCode: null,
158         productionLine: null,
159         locationCode: null,
160         equipmentNo: null,
161         paramCode: null,
162         paramValue: null,
163         paramUpper: null,
164         paramLower: null,
165         paramStandard: null,
166         collectionTime: null,
167         spareField1: null,
168         spareField2: null,
169         createUser: null,
170         createTime: null,
171         updateUser: null,
172         updateTime: null,
173         state: null,
174         paramName: null,
175         unit: null,
176         type: '外漏检测',
177       };
178       this.resetForm("form");
179     },
180     /** 搜索按钮操作 */
181     handleQuery() {
182       this.queryParams.pageNum = 1;
183       this.getList();
184     },
185     /** 重置按钮操作 */
186     resetQuery() {
187       this.resetForm("queryForm");
188       this.handleQuery();
189     },
190     // 多选框选中数据
191     handleSelectionChange(selection) {
192       this.ids = selection.map(item => item.id)
193       this.single = selection.length !== 1
194       this.multiple = !selection.length
195     },
196
197     getList() {
198       this.loading = true;
199       listParamCollection(this.queryParams).then(response => {
200         this.detectionReportList = response.rows;
201         this.total = response.total;
202         this.loading = false;
203       });
204     },
205
206   },
207 }
208
209 </script>
210
211 <style scoped>
212 ::v-deep .el-form-item__label{
213   font-size: large;
214 }
215 ::v-deep .el-card__body{
216   padding: 15px 20px 0px 20px;
217 }
218 </style>