hdy
2024-07-10 a4362dfe3e0e9c6fad426685da0065455799d018
提交 | 用户 | 时间
0cceb6 1 <template>
Y 2   <div class="app-container">
3     <el-card class="box-card" >
4       <el-row>
5         <el-divider><span style="font-size: 30px">发动机返修标记系统</span></el-divider>
6       </el-row>
7       <el-row style="margin-top: 10px">
8         <el-form :model="queryParams.sfcCode" ref="queryForm" :inline="true" label-width="68px" >
9           <el-form-item label-width="120" label="发动机号:" prop="orderNo">
10             <el-input
11               v-model="queryParams.sfcCode"
12               placeholder="请输入发动机号"
13               clearable
14               @keyup.enter.native="handleQuery"
15             />
16           </el-form-item>
17           <el-form-item style="margin-left: 20px">
18             <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">查询</el-button>
19             <el-button type="primary" icon="el-icon-scissors" @click="repairProgressHandleQuery">返修进度</el-button>
20           </el-form-item>
21         </el-form>
22       </el-row>
23     </el-card>
24     <el-row>
25       <el-col :span="20">
26         <el-card style="margin-top: 10px; height: 490px;" class="box-card">
27           <el-tabs v-model="activeName">
28             <el-tab-pane label="过站采集" name="first">
29               <el-table max-height="410px" border ref="multipleTable" :data="passingStationCollectionList"  @selection-change="handleSelectionChange">
30                 <el-table-column type="selection" width="55" align="center" />
31 <!--                <el-table-column label="工单编号" width="120" align="center" prop="workOrderNo">
32                 </el-table-column>-->
33                 <el-table-column label="发动机号" min-width="160" align="center" prop="sfcCode">
34                 </el-table-column>
35 <!--                <el-table-column label="产品编号" align="center" prop="productCode">
36                 </el-table-column>
37                 <el-table-column label="产线编号" align="center" prop="productionLine">
38                 </el-table-column>-->
39                 <el-table-column label="工位编号" align="center" prop="locationCode">
40                 </el-table-column>
41                 <el-table-column label="入站时间" align="center" prop="inboundTime" width="160">
42                   <template slot-scope="scope">
43                     <span>{{ parseTime(scope.row.inboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
44                   </template>
45                 </el-table-column>
46                 <el-table-column label="出站时间" align="center" prop="outboundTime" width="160">
47                   <template slot-scope="scope">
48                     <span>{{ parseTime(scope.row.outboundTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
49                   </template>
50                 </el-table-column>
51                 <el-table-column label="是否合格" align="center" prop="outRsSign">
52                 </el-table-column>
53 <!--                <el-table-column label="NG原因" align="center" prop="outMsgSign">
54                 </el-table-column>-->
55                 <el-table-column label="采集时间" align="center" prop="collectionTime" width="160">
56                   <template slot-scope="scope">
57                     <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
58                   </template>
59                 </el-table-column>
60 <!--                <el-table-column label="节拍时间" align="center" prop="beatTime">
61                 </el-table-column>-->
62               </el-table>
63             </el-tab-pane>
64             <el-tab-pane label="返修记录" name="second" @tab-click="handleClick">
65               <el-table max-height="410px" border :data="repairRecordList">
66                 <el-table-column label="发动机号" min-width="160" align="center" prop="boxCode" />
67                 <el-table-column label="工位号" align="center" prop="processesCode" />
68                 <el-table-column label="返修结果" align="center" prop="repairResults" />
69                 <el-table-column label="原结果" align="center" prop="originalResult" />
70                 <el-table-column label="返修时间" align="center"  prop="repairTime" />
71               </el-table>
72             </el-tab-pane>
73           </el-tabs>
74
75         </el-card>
76       </el-col>
77       <el-col :span="4">
78         <el-card style="margin-top: 10px; min-height: 490px">
79           <el-row class="centered-row">
80             <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-s-grid" @click="selectAll" >选 择 所 有</el-button>
81           </el-row>
82           <el-row class="centered-row">
83             <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-close" @click="clearAll">取 消 选 择</el-button>
84           </el-row>
85           <el-row class="centered-row">
86             <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-document-remove" @click="selectUnqualified">选择不合格</el-button>
87           </el-row>
88           <el-row class="centered-row">
89             <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-s-flag" @click="markComplete">标 记 完 成</el-button>
90           </el-row>
91           <el-row class="centered-row">
92           <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-files" @click="repairRecord">返 修 记 录</el-button>
93         </el-row>
94           <el-row class="centered-row">
95             <el-button type="success" style="margin-top: 10px;width:120px;height:40px" icon="el-icon-date" @click="operationLog" >操 作 日 志</el-button>
96           </el-row>
97         </el-card>
98       </el-col>
99     </el-row>
100
101
102   </div>
103 </template>
104
105 <script>
106 import {
107   noPageList,
108   insertRepairRecordByIds
109 } from "@/api/main/da/passingStationCollection/passingStationCollection";
110 import {noPagelist} from "@/api/main/rm/repairRecord/repairRecord";
111 import {warning} from "@riophae/vue-treeselect/src/utils";
112 export default {
113   name: "index",
114   dicts: ['sys_normal_disable'],
115   data(){
116     return{
117
118       loading: false,//刷新修改
119
120       activeName: 'first',
121
122       // 返修记录表格数据
123       repairRecordList: [],
124       // 是否显示弹出层
125       open: false,
126       // 产品过站采集表格数据
127       passingStationCollectionList: [],
128       // 查询参数
129       queryParams: {
130         sfcCode: '',
131         outRsSign: '',
132       },
133       ids: [],
134       allSelected: false,
135       boxCode: '',
136       // rules: {
137       //   boxCode: [
138       //     { required: true, message: "状态不能为空", trigger: "blur" }
139       //   ]
140       // },
141     }
142   },
143   mounted() {
144     // this.getList()
145   },
146   methods:{
147     handleClick(tab, event) {
148       console.log(tab, event);
149       this.$modal.msgSuccess(tab,event);
150
151     },
152     // 取消按钮
153     cancel() {
154       this.open = false;
155     },
156     selectAll(){
157       this.passingStationCollectionList.forEach(row => {
158         this.$refs.multipleTable.toggleRowSelection(row);
159       });
160     },
161     clearAll(){
162       this.$refs.multipleTable.clearSelection();
163     },
164     selectUnqualified(){
165       let outRsSign = this.passingStationCollectionList.filter(row => row.outRsSign === '合格')
166       outRsSign.forEach(row => {
167         this.$refs.multipleTable.toggleRowSelection(row);
168       })
169       this.$modal.msgSuccess('选择不合格');
170     },
171     markComplete(){
172       if(this.ids.length === 0){
173         this.$message({
174           message: '未标记!',
175           type: 'warning'
176         })
177       }else {
178         this.loading = true; // 开始加载数据
179         this.$modal.msgSuccess('标记完成');
180
181         let queryParams = {
182           ids: this.ids
183         }
184         this.repairRecordList = []
185         insertRepairRecordByIds(queryParams).then(response => {
186                this.initRepairRecord(); // 刷新返修记录
187                this.loading = false; // 结束加载数据
188         }).catch(() => {
189           this.loading = false; // 结束加载数据
190         });
191         // this.initRepairRecord()
192         // this.getList();
193       }
194       this. handleQuery();
195     },
196     repairRecord(){
197       this.$modal.msgSuccess('返修记录');
198     },
199     operationLog(){
200       this.$modal.msgSuccess('操作日志');
201     },
202     // 多选框选中数据
203     handleSelectionChange(selection) {
204       this.ids = selection.map(item => item.id)
205       this.single = selection.length!==1
206       this.multiple = !selection.length
207     },
208     repairProgressHandleQuery(){
209       this.activeName = 'second'
210     },
211     initRepairRecord(){
212       /** 查询返修记录列表 */
213       let queryParams = {
214         boxCode: this.queryParams.sfcCode
215       }
216
217       noPagelist(queryParams).then(response => {
218         this.repairRecordList = response.rows;
219       });
220
221     },
222     /** 搜索按钮操作 */
223     handleQuery() {
224       let sfcCode = this.queryParams.sfcCode
225       if(sfcCode === null||sfcCode ===''){
226         this.$message({
227           message: '请填写发动机号!',
228           type: 'warning'
229         });
230       }else {
231         // this.$modal.msgSuccess('搜索');
232         this.getList();
233         this.initRepairRecord();
234       }
235     },
236     /** 查询产品过站采集列表 */
237     getList() {
238       noPageList(this.queryParams).then(response => {
239         this.passingStationCollectionList = response.rows;
240       });
241     },
242
243   },
244 }
245 </script>
246
247 <style scoped>
248 ::v-deep .el-form-item__label{
249   font-size: large;
250 }
251 .el-icon-close {
252   margin-left: 20px;
253 }
254 .centered-row {
255   margin-top: 10px;
256   display: flex;
257   justify-content: center;
258 }
259 </style>