春风项目四线(合箱线、总装线)
cl
2024-01-23 b1384252a705821b61ce38e4927761d409273763
提交 | 用户 | 时间
b51361 1 <template>
W 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="120"  label="采集时间" prop="startDate">
18             <el-date-picker
19               v-model="dateRange"
20               type="daterange"
21               range-separator="至"
22               start-placeholder="开始日期"
23               end-placeholder="结束日期">
24             </el-date-picker>
25         </el-form-item>
26         <el-form-item style="float: right">
27           <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button>
28           <el-button type=""    icon="el-icon-refresh"  @click="resetQuery">重置</el-button>
29         </el-form-item>
30       </el-form>
31     </el-card>
32
33     <el-card style="margin-top: 10px" class="box-card">
34       <el-table v-loading="loading" border :data="tightenReportList" @selection-change="handleSelectionChange" v-if="tightenReportList.length > 0">
35         <el-table-column type="selection" width="55" align="center" />
36         <el-table-column label="箱体编码" align="center" width="200" prop="sfcCode"></el-table-column>
37         <el-table-column label="工位" align="center" prop="locationCode"></el-table-column>
38         <el-table-column label="参数编码" align="center" prop="paramCode"></el-table-column>
39         <el-table-column label="参数名称" align="center" prop="paramName"></el-table-column>
40         <el-table-column label="参数值" align="center" prop="paramValue"></el-table-column>
41         <el-table-column label="采集时间" align="center" prop="collectionTime" width="180">
42           <template slot-scope="scope">
43             <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d}') }}</span>
44           </template>
45         </el-table-column>
46         <el-table-column label="状态" align="center" prop="state"></el-table-column>
47         <el-table-column label="单位" align="center" prop="unit"></el-table-column>
48       </el-table>
49       <el-empty v-else>
50         <span slot="description">暂无数据</span>
51       </el-empty>
52     </el-card>
53
54     <pagination
55       v-show="total>0"
56       :total="total"
57       :page.sync="queryParams.pageNum"
58       :limit.sync="queryParams.pageSize"
59       @pagination="getList"
60     />
61
62   </div>
63 </template>
64 <script>
65 import { listParamCollection, getParamCollection, delParamCollection, addParamCollection, updateParamCollection } from "@/api/main/da/paramCollection/paramCollection";
66 export default {
67   name: "index",
68   computed: {
69   },
70   dicts: ['sys_normal_disable','order_scheduling_produce_status','print_status'],
71   components: {
72   },
73   data(){
74     return{
75       dateRange: '',
76       // 用于存储选择的日期范围
77       total: 0,
78       ids: [],
79       tightenReportList: [],
80       loading: true,
81       single: true,
82       // 非多个禁用
83       multiple: true,
84       // 显示搜索条件
85       showSearch: true,
86       // 查询参数
87       queryParams: {
88         pageNum: 1,
89         pageSize: 10,
90         workOrderNo: null,
91         sfcCode: null,
92         productCode: null,
93         productionLine: null,
94         locationCode: null,
95         equipmentNo: null,
96         paramCode: null,
97         paramValue: null,
98         paramUpper: null,
99         paramLower: null,
100         paramStandard: null,
101         collectionTime: null,
102         spareField1: null,
103         spareField2: null,
104         createUser: null,
105         createTime: null,
106         updateUser: null,
107         updateTime: null,
108         state: null,
109         paramName: null,
110         unit: null,
111         type: '拧紧数据',
112         startDate: null,
113         endDate: null
114       },
115     }
116   },
117   created() {
118     this.getList();
119   },
db8f36 120   methods: {
b51361 121
db8f36 122     //   async fetchData() {
H 123     //     // 构建API请求的URL,使用选择的日期范围作为查询参数
124     //     const url = `@/api/main/da/paramCollection/paramCollection?startDate=${this.dateRange[0]}&endDate=${this.dateRange[1]}`;
125     //
126     //     try {
127     //       // 发送API请求,获取查询结果
128     //       const response = await fetch(url);
129     //       const data = await response.json();
130     //       console.log(data); // 处理查询结果,比如在控制台输出或显示在页面上
131     //     } catch (error) {
132     //       console.error('Error fetching data:', error);
133     //     }
134     //   },
135     // },
b51361 136
db8f36 137     reset() {
b51361 138       this.form = {
W 139         id: null,
140         workOrderNo: null,
141         sfcCode: null,
142         productCode: null,
143         productionLine: null,
144         locationCode: null,
145         equipmentNo: null,
146         paramCode: null,
147         paramValue: null,
148         paramUpper: null,
149         paramLower: null,
150         paramStandard: null,
151         collectionTime: null,
152         spareField1: null,
153         spareField2: null,
154         createUser: null,
155         createTime: null,
156         updateUser: null,
157         updateTime: null,
158         state: null,
159         paramName: null,
160         unit: null,
161         type: '拧紧数据',
162       };
163       this.resetForm("form");
164     },
165     /** 搜索按钮操作 */
166     handleQuery() {
167       this.queryParams.pageNum = 1;
168       this.getList();
169     },
170     /** 重置按钮操作 */
171     resetQuery() {
172       this.resetForm("queryForm");
173       this.handleQuery();
174     },
175     // 多选框选中数据
176     handleSelectionChange(selection) {
177       this.ids = selection.map(item => item.id)
db8f36 178       this.single = selection.length !== 1
b51361 179       this.multiple = !selection.length
W 180     },
181
182     getList() {
183       this.loading = true;
184       listParamCollection(this.queryParams).then(response => {
185         this.tightenReportList = response.rows;
186         this.total = response.total;
187         this.loading = false;
188       });
189     },
190
db8f36 191   },
b51361 192 }
db8f36 193
b51361 194 </script>
W 195
196 <style scoped>
197 ::v-deep .el-form-item__label{
198   font-size: large;
199 }
200 ::v-deep .el-card__body{
201   padding: 15px 20px 0px 20px;
202 }
203 </style>