hdy
5 天以前 51eb318f6df9ebc7d1ff47522e33b2ee7cea1ba8
提交 | 用户 | 时间
20c287 1 <template>
A 2   <div class="app-container">
3     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
4       <el-form-item label-width="120" label="总成序列号" prop="sfcCode">
5         <el-input
6           v-model="queryParams.sfcCode"
7           placeholder="请输入总成序列号"
8           clearable
9           @keyup.enter.native="handleQuery"
10         />
11       </el-form-item>
b15739 12       <el-form-item label-width="120" label="采集时间" prop="timeQuery">
A 13         <el-date-picker
14           v-model="queryParams.timeQuery"
15           type="datetimerange"
16           range-separator="至"
17           value-format="yyyy-MM-dd HH:mm:ss"
18           start-placeholder="开始日期"
19           end-placeholder="结束日期">
20         </el-date-picker>
20c287 21       </el-form-item>
A 22       <el-form-item style="float: right">
23         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
24         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
b15739 25         <el-button icon="el-icon-setting" size="mini" @click="toggleAdvancedSearch">高级查询</el-button>
20c287 26       </el-form-item>
b15739 27       <transition name="fade">
A 28         <div v-if="advancedSearchVisible" class="advanced-search">
29           <el-form-item label-width="100" label="参数集编码" prop="paramSetCode">
30             <el-input
31               v-model="queryParams.paramSetCode"
32               placeholder="请输入参数集编码"
33               clearable
34               @keyup.enter.native="handleQuery"
35             />
36           </el-form-item>
37           <el-form-item label-width="100" label="参数集名称" prop="paramSetName">
38             <el-input
39               v-model="queryParams.paramSetName"
40               placeholder="请输入参数集名称"
41               clearable
42               @keyup.enter.native="handleQuery"
43             />
44           </el-form-item>
45           <el-form-item label="工位编码" prop="locationCode">
46             <el-input
47               v-model="queryParams.locationCode"
48               placeholder="请输入工位编码"
49               clearable
50               @keyup.enter.native="handleQuery"
51             />
52           </el-form-item>
53           <el-row>
54             <el-col :span="24" style="text-align: right;">
55               <el-button type="primary" icon="el-icon-close" size="mini" @click="toggleAdvancedSearch">关闭</el-button>
56             </el-col>
57           </el-row>
58         </div>
59       </transition>
20c287 60     </el-form>
A 61
62     <el-row :gutter="10" class="mb8">
b15739 63 <!--      <el-col :span="1.5">-->
A 64 <!--        <el-button-->
65 <!--          type="primary"-->
66 <!--          plain-->
67 <!--          icon="el-icon-plus"-->
68 <!--          size="mini"-->
69 <!--          @click="handleAdd"-->
70 <!--          v-hasPermi="['da:tightenCollection:add']"-->
71 <!--        >新增</el-button>-->
72 <!--      </el-col>-->
73 <!--      <el-col :span="1.5">-->
74 <!--        <el-button-->
75 <!--          type="success"-->
76 <!--          plain-->
77 <!--          icon="el-icon-edit"-->
78 <!--          size="mini"-->
79 <!--          :disabled="single"-->
80 <!--          @click="handleUpdate"-->
81 <!--          v-hasPermi="['da:tightenCollection:edit']"-->
82 <!--        >修改</el-button>-->
83 <!--      </el-col>-->
84 <!--      <el-col :span="1.5">-->
85 <!--        <el-button-->
86 <!--          type="danger"-->
87 <!--          plain-->
88 <!--          icon="el-icon-delete"-->
89 <!--          size="mini"-->
90 <!--          :disabled="multiple"-->
91 <!--          @click="handleDelete"-->
92 <!--          v-hasPermi="['da:tightenCollection:remove']"-->
93 <!--        >删除</el-button>-->
94 <!--      </el-col>-->
20c287 95       <el-col :span="1.5">
A 96         <el-button
97           type="warning"
98           plain
99           icon="el-icon-download"
100           size="mini"
101           @click="handleExport"
102           v-hasPermi="['da:tightenCollection:export']"
103         >导出</el-button>
104       </el-col>
b15739 105 <!--      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
20c287 106     </el-row>
A 107
108     <el-table border v-loading="loading" :data="tightenCollectionList" @selection-change="handleSelectionChange">
109       <el-table-column type="selection" width="55" align="center" />
110 <!--      <el-table-column label="主键id" align="center" prop="id" />-->
111       <el-table-column label="总成序列号" align="center" prop="sfcCode" />
112       <el-table-column label="工位编码" align="center" prop="locationCode" />
113       <el-table-column label="参数集编码" align="center" prop="paramSetCode" />
114       <el-table-column label="参数集名称" align="center" prop="paramSetName" />
115       <el-table-column label="扭矩值" align="center" prop="torque" />
116       <el-table-column label="扭矩状态" align="center" prop="torqueStatus" />
117       <el-table-column label="角度值" align="center" prop="angle" />
118       <el-table-column label="角度状态" align="center" prop="angleStatus" />
119       <el-table-column label="采集时间" align="center" prop="collectTime" width="180">
120       </el-table-column>
121     </el-table>
122
123     <pagination
124       v-show="total>0"
125       :total="total"
126       :page.sync="queryParams.pageNum"
127       :limit.sync="queryParams.pageSize"
128       @pagination="getList"
129     />
130
131     <!-- 添加或修改拧紧采集对话框 -->
132     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
133       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
134         <el-form-item label="总成序列号" prop="sfcCode">
135           <el-input v-model="form.sfcCode" placeholder="请输入总成序列号" />
136         </el-form-item>
137         <el-form-item label="工位编码" prop="locationCode">
138           <el-input v-model="form.locationCode" placeholder="请输入工位编码" />
139         </el-form-item>
140         <el-form-item label="参数集编码" prop="paramSetCode">
141           <el-input v-model="form.paramSetCode" placeholder="请输入参数集编码" />
142         </el-form-item>
143         <el-form-item label="参数集名称" prop="paramSetName">
144           <el-input v-model="form.paramSetName" placeholder="请输入参数集名称" />
145         </el-form-item>
146         <el-form-item label="扭矩值" prop="torque">
147           <el-input v-model="form.torque" placeholder="请输入扭矩值" />
148         </el-form-item>
149         <el-form-item label="角度值" prop="angle">
150           <el-input v-model="form.angle" placeholder="请输入角度值" />
151         </el-form-item>
152       </el-form>
153       <div slot="footer" class="dialog-footer">
154         <el-button type="primary" @click="submitForm">确 定</el-button>
155         <el-button @click="cancel">取 消</el-button>
156       </div>
157     </el-dialog>
158   </div>
159 </template>
160
161 <script>
162 import { listTightenCollection, getTightenCollection, delTightenCollection, addTightenCollection, updateTightenCollection } from "@/api/main/da/tightenCollection";
163
164 export default {
165   name: "TightenCollection",
166   data() {
167     return {
b15739 168       advancedSearchVisible: false,
20c287 169       // 遮罩层
A 170       loading: true,
171       // 选中数组
172       ids: [],
173       // 非单个禁用
174       single: true,
175       // 非多个禁用
176       multiple: true,
177       // 显示搜索条件
178       showSearch: true,
179       // 总条数
180       total: 0,
181       // 拧紧采集表格数据
182       tightenCollectionList: [],
183       // 弹出层标题
184       title: "",
185       // 是否显示弹出层
186       open: false,
187       // 查询参数
188       queryParams: {
189         pageNum: 1,
190         pageSize: 10,
191         sfcCode: null,
192         locationCode: null,
193         paramSetCode: null,
194         paramSetName: null,
195         torqueStatus: null,
196         angleStatus: null,
b15739 197         collectTime: null,
A 198         timeQuery: []
20c287 199       },
A 200       // 表单参数
201       form: {},
202       // 表单校验
203       rules: {
204       }
205     };
206   },
207   created() {
208     this.getList();
209   },
210   methods: {
211     toggleAdvancedSearch() {
212       this.advancedSearchVisible = !this.advancedSearchVisible;
213     },
214     /** 查询拧紧采集列表 */
215     getList() {
216       this.loading = true;
217       listTightenCollection(this.queryParams).then(response => {
218         this.tightenCollectionList = response.rows;
219         this.total = response.total;
220         this.loading = false;
221       });
222     },
223     // 取消按钮
224     cancel() {
225       this.open = false;
226       this.reset();
227     },
228     // 表单重置
229     reset() {
230       this.form = {
231         id: null,
232         sfcCode: null,
233         locationCode: null,
234         paramSetCode: null,
235         paramSetName: null,
236         torque: null,
237         torqueStatus: null,
238         angle: null,
239         angleStatus: null,
240         collectTime: null
241       };
242       this.resetForm("form");
243     },
244     /** 搜索按钮操作 */
245     handleQuery() {
246       this.queryParams.pageNum = 1;
247       this.getList();
b15739 248       this.advancedSearchVisible = false
20c287 249     },
A 250     /** 重置按钮操作 */
251     resetQuery() {
b15739 252       this.clearQueryParams()
20c287 253       this.resetForm("queryForm");
A 254       this.handleQuery();
255     },
256     // 多选框选中数据
257     handleSelectionChange(selection) {
258       this.ids = selection.map(item => item.id)
259       this.single = selection.length!==1
260       this.multiple = !selection.length
b15739 261     },
A 262     clearQueryParams(){
263       this.queryParams.paramSetName = null
264       this.queryParams.paramSetName = null
265       this.queryParams.locationCode = null
20c287 266     },
A 267     /** 新增按钮操作 */
268     handleAdd() {
269       this.reset();
270       this.open = true;
271       this.title = "添加拧紧采集";
272     },
273     /** 修改按钮操作 */
274     handleUpdate(row) {
275       this.reset();
276       const id = row.id || this.ids
277       getTightenCollection(id).then(response => {
278         this.form = response.data;
279         this.open = true;
280         this.title = "修改拧紧采集";
281       });
282     },
283     /** 提交按钮 */
284     submitForm() {
285       this.$refs["form"].validate(valid => {
286         if (valid) {
287           if (this.form.id != null) {
288             updateTightenCollection(this.form).then(response => {
289               this.$modal.msgSuccess("修改成功");
290               this.open = false;
291               this.getList();
292             });
293           } else {
294             addTightenCollection(this.form).then(response => {
295               this.$modal.msgSuccess("新增成功");
296               this.open = false;
297               this.getList();
298             });
299           }
300         }
301       });
302     },
303     /** 删除按钮操作 */
304     handleDelete(row) {
305       const ids = row.id || this.ids;
306       this.$modal.confirm('是否确认删除拧紧采集编号为"' + ids + '"的数据项?').then(function() {
307         return delTightenCollection(ids);
308       }).then(() => {
309         this.getList();
310         this.$modal.msgSuccess("删除成功");
311       }).catch(() => {});
312     },
313     /** 导出按钮操作 */
314     handleExport() {
315       this.download('da/tightenCollection/export', {
316         ...this.queryParams
317       }, `tightenCollection_${new Date().getTime()}.xlsx`)
318     }
319   }
320 };
321 </script>
b15739 322 <style scoped>.fade-enter-active, .fade-leave-active {
A 323   transition: opacity 0.3s;
324 }
325 .fade-enter, .fade-leave-to /* .fade-leave-active in <2.1.8 */ {
326   opacity: 0;
327 }
328
329 .advanced-search {
330   position: absolute;
331   background: #FFFFFF; /* 设置为与页面背景色相同或相近的颜色 */
332   border-left: 1px solid #dcdfe6;
333   border-right: 1px solid #dcdfe6;
334   border-bottom: 1px solid #dcdfe6;
335   /*border: none;*/
336   box-shadow: none; /* 移除阴影 */
337   padding: 10px;
338   z-index: 1000; /* 确保浮动在其他元素之上 */
339   top: 70px; /* 调整顶部位置,使其与页面其他元素更协调 */
340   left: 20px; /* 调整左侧位置 */
341   width: 97%; /* 调整宽度 */
342   /*max-width: 1296px; !* 最大宽度 *!*/
343   /*max-width: 1296px; !* 最大宽度 *!*/
344   margin: 0 auto; /* 居中对齐 */
345 }
346 </style>