春风项目四线(合箱线、总装线)
wujian
2024-09-04 e4a393c219c3c48cbf0e4af615b316facb82eb62
提交 | 用户 | 时间
1c7036 1 <template>
Y 2   <div class="app-container">
3     <div style="width: 100%">
4       <el-card class="box-card" >
45f460 5         <el-form :model="from" size="large" :inline="true" label-width="78px" @submit.native.prevent>
5030f3 6           <el-form-item label-width="200" label="连杆码" :prop="from.scanObject2"  style="align-content: center">
Y 7             <input v-model="from.scanObject2"
45f460 8                    ref="inputdata1"
5030f3 9                    style="height: 39px; width: 300px"
Y 10                    placeholder="请输入连杆码"
1c7036 11             />
Y 12           </el-form-item>
13         </el-form>
14       </el-card>
59e228 15       <el-row :gutter="0">
W 16         <el-col :span="6">
17           <div >
18             <el-card style="height: 500px">
19               <el-descriptions class="margin-top" :column="1" direction="horizontal">
20                 <el-descriptions-item label="机型">{{queryParams.productSeries}}</el-descriptions-item>
21                 <el-descriptions-item label="发动机编号">{{queryParams.sfcCode}}</el-descriptions-item>
22                 <el-descriptions-item label="曲轴码">{{queryParams.scanObject1}}</el-descriptions-item>
23                 <el-descriptions-item label="连杆码">{{queryParams.scanObject2}}</el-descriptions-item>
24                 <el-descriptions-item label="瓦名称">{{queryParams.tileName}}</el-descriptions-item>
25                 <!--                <el-descriptions-item label="缸体编号">{{queryParams.axisName}}</el-descriptions-item>-->
26                 <el-descriptions-item label="1缸配瓦颜色"><span  style="color: #FFFFFF;"  :style="{ backgroundColor: queryParams.tileColor1 }">{{queryParams.tileColor1}}</span></el-descriptions-item>
27                 <el-descriptions-item label="2缸配瓦颜色"><span  style="color: #FFFFFF;"  :style="{ backgroundColor: queryParams.tileColor2 }">{{queryParams.tileColor2}}</span></el-descriptions-item>
28                 <el-descriptions-item label="3缸配瓦颜色"><span  style="color: #FFFFFF;"  :style="{ backgroundColor: queryParams.tileColor3 }">{{queryParams.tileColor3}}</span></el-descriptions-item>
29               </el-descriptions>
30             </el-card>
1c7036 31           </div>
59e228 32         </el-col>
W 33         <el-col :span="18">
34           <div>
35             <el-card style="height: 500px; overflow: auto">
36               <el-table border :data="tileMatchMiddlewareList">
37                 <el-table-column
38                   type="index"
39                   label="序号"
40                   width="50"
41                   align="center"></el-table-column>
42                 <el-table-column label="发动机号" align="center" prop="sfcCode" width="180"></el-table-column>
43                 <el-table-column label="曲轴码" align="center" prop="crankshaftNo" width="250"></el-table-column>
44                 <el-table-column label="连杆码" align="center" prop="connectingrodNo" width="250"></el-table-column>
45                 <el-table-column label="气缸编号" align="center" prop="cylinder" width="100"></el-table-column>
46                 <el-table-column label="状态" align="center" prop="state" width="100">
47                   <template slot-scope="scope">
48                     <dict-tag :options="dict.type.corod" :value="scope.row.state"/>
49                   </template>
50                 </el-table-column>
51               </el-table>
52               <pagination
53                 v-show="total>0"
54                 :total="total"
55                 :page.sync="queryParams.pageNum"
56                 :limit.sync="queryParams.pageSize"
57                 @pagination="getListData"
58               />
59             </el-card>
60           </div>
61         </el-col>
62       </el-row>
1c7036 63     </div>
Y 64   </div>
65 </template>
66 <script>
67 import VueQr from 'vue-qr'
5030f3 68 import {setBarcode} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware";
e4a393 69 import {listTileMatchRules2} from "@/api/main/bs/tileMatchRules/tileMatchRules";
59e228 70 import {listTileMatchMiddleware} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware";
W 71 import {getSumDataMethod} from "@/api/main/bs/orderScheduling/orderScheduling";
1c7036 72 export default {
Y 73   name: "index",
59e228 74   dicts: ['colour_hex','productseries','axisname','neckname','tilename','corod'],
1c7036 75   components: {
Y 76     VueQr,
77   },
78   data(){
79     return{
59e228 80       total: 0,
5030f3 81       scannerFlag: false,
1c7036 82       loading: true,
Y 83       tileMatchKbList: [],
59e228 84       tileMatchMiddlewareList: [],
1c7036 85       qrCode: '',
Y 86       // 查询参数
87       from:{
59e228 88         locationCode: 'CR010',
1c7036 89         pageNum: 1,
Y 90         pageSize: 10,
59e228 91         productSeries:'',
1c7036 92         scanObject1: null,
5030f3 93         scanObject2: null,
1c7036 94         axisName: null,
Y 95         neckName: null,
5030f3 96         tileName: '连杆瓦',
1c7036 97         axisParameterNoPosition: null,
Y 98         neckParameterPosition: null,
99         axisValue: null,
100         neckValue: null,
101         createUser: null,
102         updateUser: null,
103         state: null,
104         weight: null,
105       },
106       queryParams: {
107         pageNum: 1,
108         pageSize: 10,
109         productSeries: null,
110         scanObject1: null,
111         scanObject2: null,
112         axisName: null,
113         neckName: null,
114         tileName: null,
115         axisParameterNoPosition: null,
116         neckParameterPosition: null,
117         axisValue: null,
118         neckValue: null,
59e228 119         tileColor1: null,
W 120         tileColor2: null,
121         tileColor3: null,
122         tileColor4: null,
1c7036 123         createUser: null,
Y 124         updateUser: null,
125         state: null,
126         weight: null,
45f460 127         sfcCode:null,
1c7036 128       },
Y 129     }
130   },
5030f3 131   mounted() {
45f460 132     this.setFocus1()
59e228 133     this.getListData()
45f460 134     this.$refs.inputdata1.addEventListener('keydown',this.handleScannerInput1)
5030f3 135   },
Y 136   beforeDestroy() {
45f460 137     this.$refs.inputdata1.removeEventListener('keydown',this.handleScannerInput1)
5030f3 138   },
1c7036 139   methods:{
5030f3 140     refresh() {
Y 141       location.reload();
142     },
45f460 143     setFocus1(){
5030f3 144       this.$nextTick(()=>{
45f460 145         this.$refs.inputdata1.focus()
5030f3 146       })
Y 147     },
45f460 148     handleScannerInput1(event){
5030f3 149       if (this.scannerFlag){
45f460 150         this.$refs.inputdata1.value = ''
5030f3 151         this.scannerFlag = false
Y 152       }
153       const input = event.target
154       const inputValue = input.value
155       this.from.scanObject2 = inputValue
156       if (event.key === 'Enter'){
157         this.scannerFlag = true
158         //扫描完成
59e228 159         console.log('sssss',this.from.scanObject2)
W 160         if (this.from.scanObject2 !== null && this.from.scanObject2 !== '') {
161           console.log('r22222222222222222')
162           if (this.from.scanObject2.indexOf(";") !== -1){
163             const parts1 = this.from.scanObject2.split(";");
164             console.log('paes',parts1)
165             if (parts1.length >= 3) {
166               setBarcode({barcode:this.from.scanObject2,locationCode:this.from.locationCode}).then(res =>{
167                 console.log('res123456',res)
168                 if (res.id !== null && res.id !== ''){
169                   this.$message({
170                     message: '配瓦成功',
171                     type: 'success'
172                   });
173                   this.from.productSeries = res.productType
174                   this.queryParams.productSeries = res.productType
175                   this.queryParams.sfcCode=res.sfcCode;
176                   this.from.scanObject1=res.crankshaftNo;
177                   this.from.connectingrodNo=res.connectingrodNo;
178                   this.queryParams.axisName=res.cylinder;
d2daac 179                   if (res.checkFlag === "1"){
W 180                     this.queryParams.tileColor2 = null
181                     this.queryParams.tileColor3 = null
182                   }
59e228 183                   this.handleQuery()
W 184                 }
185                 //this.queryParams.scanObject1=this.from.scanObject1
186               })
187             } else {
188               this.$message({
189                 message: '连杆码格式错误,请检查',
190                 type: 'error'
191               });
192             }
193           }else {
194             this.$message({
195               message: '连杆码格式错误,请检查',
196               type: 'error'
197             });
198           }
199
200         }else {
201           this.$message({
202             message: '连杆码格式错误,请检查',
203             type: 'error'
204           });
205           console.log('3232323')
206           // this.handleQuery()
5030f3 207         }
59e228 208
5030f3 209       }
Y 210     },
1c7036 211     /** 搜索按钮操作 */
Y 212     handleQuery() {
213       this.clear();
59e228 214       console.log("1111")
W 215       if(this.from.scanObject2 !== null && this.from.productSeries !== null && this.from.productSeries !== "")
1c7036 216       {
59e228 217         console.log("222")
1c7036 218         this.axisValueextracted();
Y 219         this.neckValueextracted();
59e228 220         console.log('this.queryParams.axisValue',this.queryParams.axisValue)
W 221         console.log('this.queryParams.neckValue',this.queryParams.neckValue)
1c7036 222         if(this.queryParams.axisValue !== null && this.queryParams.neckValue !== null){
59e228 223           console.log('77777')
W 224           console.log('this.queryParams.axisValue',this.queryParams.axisValue)
225           console.log('this.queryParams.neckValue',this.queryParams.neckValue)
1c7036 226           this.insetFromToQueryParams();
Y 227           this.getList();
228         }
229         else{
59e228 230           console.log('000000')
1c7036 231           const h = this.$createElement;
Y 232           this.$message({
233             message: h('p',null, [
234               h('span', null, '警告 '),
235               h('i', { style: 'color: black' }, '箱体码或曲轴码输入有误'),
236               h()]),
237             type: 'error',
238             center: true,
239             offset:300
240           });
241         }
242       }
243       else{
244         const h = this.$createElement;
245         this.$message({
246           message: h('p',null, [
247             h('span', null, '警告 '),
248             h('i', { style: 'color: black' }, '请填写所有搜索条件'),
249             h()]),
250           type: 'error',
251           center: true,
252           offset:300
253         });
254       }
255     },
256
257     // 取箱体码第三段为配瓦值
258     axisValueextracted() {
59e228 259       console.log("33")
W 260       if (this.from.scanObject2.indexOf(";") !== -1){
261         const parts1 = this.from.scanObject2.split(";");
262         if (parts1.length >= 3) {
263           console.log("44",parts1)
264           //const axisValueextracted = parts1[2].substring(3,4);
265           const axisValueextracted = parts1[2];
266           return this.queryParams.axisValue= axisValueextracted;
1c7036 267
59e228 268         }
1c7036 269       }
Y 270     },
271
272     //取曲轴码第三段为配瓦值
273     neckValueextracted() {
59e228 274       console.log('4432')
W 275       console.log('scanObject1',this.from.scanObject1)
276       if (this.from.scanObject1.indexOf(";") !== -1){
277         const parts2 = this.from.scanObject1.split(";");
278         if (parts2.length >= 3) {
279           //const neckValueextracted = parts2[2].substring(3,4);
280           const neckValueextracted = parts2[2];
281           return this.queryParams.neckValue= neckValueextracted;
282         }
d2daac 283       } else if (this.from.scanObject1.indexOf(",") !== -1){
W 284         const parts2 = this.from.scanObject1.split(",");
285         if (parts2.length >= 2) {
286           //const neckValueextracted = parts2[2].substring(3,4);
287           const neckValueextracted = parts2[1];
288           return this.queryParams.neckValue= neckValueextracted;
289         }
1c7036 290       }
Y 291     },
292     //取配瓦颜色
293     getList() {
294       let queryParams = {
295         productSeries : this.queryParams.productSeries,
296         axisName : this.queryParams.axisName,
5030f3 297         // neckName : this.queryParams.neckName,
1c7036 298         tileName : this.queryParams.tileName,
Y 299         axisValue: this.queryParams.axisValue,
300         neckValue: this.queryParams.neckValue,
301       }
5030f3 302       console.log('参数:',queryParams)
e4a393 303       listTileMatchRules2(queryParams).then(response => {
59e228 304         console.log('this.queryParams',this.queryParams);
W 305         console.log('res',response)
306         if (response.rows.length>0){
307           if(this.queryParams.axisName===1){
308             this.queryParams.tileColor1 = response.rows[0].tileColor;
309           }
310           if(this.queryParams.axisName===2){
311             this.queryParams.tileColor2 = response.rows[0].tileColor;
312           }
313           if(this.queryParams.axisName===3){
314             this.queryParams.tileColor3 = response.rows[0].tileColor;
315           }
316         }
317
318         console.log(this.queryParams);
319         this.getListData();
1c7036 320       });
Y 321     },
322     clear(){
323       this.queryParams.axisValue=null;
324       this.queryParams.neckValue=null;
325     },
326     insetFromToQueryParams(){
327       this.queryParams.productSeries=this.from.productSeries;
328       this.queryParams.neckName=this.from.neckName;
329       this.queryParams.tileName=this.from.tileName;
330       this.queryParams.scanObject1=this.from.scanObject1;
59e228 331     },
W 332     //查询列表
333     getListData(){
334       console.log('this.queryParams111',this.dataList)
335       const query = {
336         pageNum:this.queryParams.pageNum,
337         pageSize:this.queryParams.pageSize
338       }
339       listTileMatchMiddleware(query).then(res => {
340         console.log('resssss',res)
341         if (res.code === 200){
342           // this.$message({
343           //   message: '查询成功',
344           //   type: 'success'
345           // });
346           this.tileMatchMiddlewareList = res.rows
347           this.total = res.total
348         }
349       })
1c7036 350     }
Y 351
352   },
353 }
354 </script>
355
356 <style scoped>
357 ::v-deep .el-form-item__label{
358   font-size: large;
359 }
360 ::v-deep .el-card__body{
361   padding: 15px 20px 0px 20px;
362 }
363 ::v-deep .el-input .el-input--medium .el-input--suffix{
364   width: 200px;
365 }
366
367 </style>