admin
2024-08-12 039f8973fee9e598c548816a991b875538435f03
提交 | 用户 | 时间
b78728 1 <template>
A 2   <div class="app-container">
3    <el-row :gutter="5">
bf111f 4      <el-col :span="7">
A 5        <el-card style="height: 71px;padding-top: 6px" shadow="never">
6           <span class="head-font">工位编号 : {{headContent.processesCode}}</span>
b78728 7        </el-card>
A 8      </el-col>
dd5d35 9      <el-col :span="17">
b78728 10        <el-card shadow="never">
dd5d35 11          <span class="head-font">物料编码 : </span>
3c3c4d 12          <el-input style="width: 50%" ref="inputData" v-model="materialCode" @change="handleEnter" placeholder="请扫描物料编码"></el-input>
dd5d35 13          <el-button @click="clearClick" style="float: right" type="danger" >清除</el-button>
b78728 14        </el-card>
A 15      </el-col>
16
17    </el-row>
18    <el-row :gutter="5" style="margin-top: 5px">
19      <el-col :span="7" >
20        <el-card class="bottom-card">
21          <div slot="header" class="clearfix">
22            <i class="el-icon-tickets"></i>
23            <span style="font-weight: bold">当前工件信息</span>
24          </div>
25          <el-descriptions :column="1" border :content-style="{'min-width': '140px'}">
dd5d35 26            <el-descriptions-item label="产品序列号">
A 27              <span>{{headContent.sfcCode}}</span>
28            </el-descriptions-item>
b78728 29            <el-descriptions-item label="工单编号">
A 30                <span>{{workpieceInformation.workOrderNo}}</span>
31            </el-descriptions-item>
32            <el-descriptions-item label="物料编码">
33              <span>{{workpieceInformation.materialCode}}</span>
34            </el-descriptions-item>
35            <el-descriptions-item label="计划数量">
36              <span>{{workpieceInformation.planQty}}</span>
37            </el-descriptions-item>
38            <el-descriptions-item label="开始时间">
39              <span>{{workpieceInformation.inboundTime}}</span>
40            </el-descriptions-item>
41          </el-descriptions>
42          <el-divider></el-divider>
43          <el-row>
44            <el-col :span="12">
45              <el-button class="circle-button" :class="cakeLamp.plcState ? 'circle-green-animate':'circle-red'" circle></el-button>
46              <span style="display: none">{{cakeLamp.plcState}}</span>
47              <span>&nbsp;PLC状态</span>
48            </el-col>
49            <el-col :span="12">
50              <el-button class="circle-button" :class="cakeLamp.scannerState ? 'circle-green-animate':'circle-red'" circle></el-button>
51              <span style="display: none">{{cakeLamp.scannerState}}</span>
52              <span>&nbsp;扫码枪状态</span>
53            </el-col>
54          </el-row>
55          <el-row style="margin-top: 20px">
56            <el-col :span="12">
57              <el-button class="circle-button" :class="cakeLamp.InPlace ? 'circle-green':'circle-red'" circle></el-button>
58              <span style="display: none">{{cakeLamp.InPlace}}</span>
59              <span>&nbsp;工件到位</span>
60            </el-col>
61            <el-col :span="12">
62              <el-button class="circle-button" :class="cakeLamp.scanFinish ? 'circle-green':'circle-red'" circle></el-button>
63              <span style="display: none">{{cakeLamp.scanFinish}}</span>
64              <span>&nbsp;扫码完成</span>
65            </el-col>
66          </el-row>
67          <el-row style="margin-top: 20px">
68            <el-col :span="12">
69              <el-button class="circle-button" :class="cakeLamp.startWork ? 'circle-green':'circle-red'" circle></el-button>
70              <span style="display: none">{{cakeLamp.startWork}}</span>
71              <span>&nbsp;开始作业</span>
72            </el-col>
73            <el-col :span="12">
74              <el-button class="circle-button" :class="cakeLamp.release ? 'circle-green':'circle-red'" circle></el-button>
75              <span style="display: none">{{cakeLamp.release}}</span>
76              <span>&nbsp;允许放行</span>
77            </el-col>
78          </el-row>
039f89 79          <el-row v-show="printFlag" style="margin-top: 20px">
A 80            <el-button id="print" v-print="'#printMe'" type="primary">打印</el-button>
81            <div style="display: none">
82              <div id="printMe">
83                <div style="text-align: center;margin-top: 64px">
84                  <span style="font-size: 29px;">电驱系统总成</span>
85                </div>
86                <div style="display: flex;margin-top: 2px;margin-left: 37px;font-size: 15px">
87                  <div class="div1">
88                    <div >
89                      <span>电机型号:</span><span>TZ180XSDSZX01</span><br>
90                    </div>
91                    <div style="margin-top: 4px">
92                      <span>额定功率:</span><span>30KW</span><br>
93                    </div>
94                    <div style="margin-top: 4px">
95                      <span>额定扭矩:</span><span>70N.m</span><br>
96                    </div>
97                    <div style="margin-top: 4px">
98                      <span>额定电压:</span><span>336VDS</span><br>
99                    </div>
100                    <div style="margin-top: 4px">
101                      <span>额工作制:</span><span>S9</span><br>
102                    </div>
103                    <div style="margin-top: 4px">
104                      <span>持续工作电流:</span><span>115A</span><br>
105                    </div>
106                    <div style="margin-top: 4px">
107                      <span>相数:</span><span>3</span><br>
108                    </div>
109                    <div style="margin-top: 4px">
110                      <span>零件号:</span><span>9900200461</span><br>
111                    </div>
112                  </div>
113
114                  <div class="div2" style="font-size: 15px;margin-left: 17px">
115                    <div>
116                      <span>控制器型号:</span><span>KTZ34X23SZX07</span><br>
117                    </div>
118                    <div style="margin-top: 4px">
119                      <span>峰值功率:</span><span>60KW</span><br>
120                    </div>
121                    <div style="margin-top: 4px">
122                      <span>峰值转矩:</span><span>175N.m</span><br>
123                    </div>
124                    <div style="margin-top: 4px">
125                      <span>最高转速:</span><span>12000rpm</span><br>
126                    </div>
127                    <div style="margin-top: 4px">
128                      <span>防护等级:</span><span>IP68</span><br>
129                    </div>
130                    <div style="margin-top: 4px">
131                      <span>峰值工作电流:</span><span>230A</span><br>
132                    </div>
133                    <div style="margin-top: 4px">
134                      <span>绝缘等级:</span><span>H</span><br>
135                    </div>
136                    <div style="margin-top: 4px">
137                      <span>出厂编号:</span><span>2407190000002</span><br>
138                    </div>
139                  </div>
140                </div>
141                <div style="margin-top: 2px;margin-left: 80px">
142                  <span style="font-size: 29px;">湖州智芯动力发展有限公司</span>
143                </div>
144
145
146                <div style="text-align: center;margin-top: 97px;font-size: 20px">
147                  <div style="margin-top: 8px">
148                    <span style="font-size: 22px">TZ180XSDSZX01</span><br>
149
150                  </div>
151                  <div style="margin-top: 4px">
152                    <span style="font-size: 22px">KTZ34X23SZX07</span><br>
153
154                  </div>
155                  <div style="margin-top: 4px">
156                    <span style="font-size: 22px">993083</span><br>
157
158                  </div>
159                  <div style="margin-top: 4px">
160                    <span style="font-size: 22px">9900166410</span><br>
161
162                  </div>
163                  <div style="margin-top: 4px">
164                    <span style="font-size: 22px">2407190000002</span>
165
166                  </div>
167                </div>
168
169                <div style="margin-top: 56px;display: flex;margin-left: 32px">
170                  <div ref="canvasWrapper" id="canvasWrapper1" style="width: 30%;flex: 1"></div>
171                  <div style="width: 70%;flex: 1;margin-top: 18px;margin-right: 26px">
172                         <span style="margin-left: -80px;font-size: 19px;font-family: FangSong">
173                           P9900166410#T{{headContent.sfcCode}}
174                         </span><br>
175                    <span style="margin-left: -80px;font-size: 19px;font-family: FangSong">
176                           #V993983#SSW002.005#HHW001.001#NMCU
177                         </span>
178                    <!--                      <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span>-->
179                  </div>
180                </div>
181
182                <div style="margin-top: 42px;display: flex;margin-left: 32px">
183                  <div ref="canvasWrapper" id="canvasWrapper2" style="width: 30%;flex: 1"></div>
184                  <div style="width: 70%;flex: 1;margin-top: 18px;margin-right: 26px">
185                         <span style="margin-left: -80px;font-size: 19px;font-family: FangSong">
186                           P9900166410#T{{headContent.sfcCode}}
187                         </span><br>
188                    <span style="margin-left: -80px;font-size: 19px;font-family: FangSong">
189                           #V993983#SSW002.005#HHW001.001#NMCU
190                         </span>
191                    <!--                      <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span>-->
192                  </div>
193                </div>
194
195                <div style="text-align: center;margin-left: -190px;margin-top: 45px">
196                  <div style="margin-top: 4px">
197                    <span>9900200461</span><br>
198                  </div>
199                  <div style="margin-top: 8px">
200                    <span>MCU</span><br>
201                  </div>
202                  <div style="margin-top: 8px">
203                    <span>HW 001.001</span><br>
204                  </div>
205                  <div style="margin-top: 8px">
206                    <span>SW 001.001</span><br>
207                  </div>
208                </div>
209
210              </div>
211            </div>
212          </el-row>
b78728 213          <el-row v-show="orderFlag" style="margin-top: 20px">
4280d7 214 <!--           <el-button @click="getWorkOrders" type="warning" size="mini">接收工单</el-button>-->
b78728 215          </el-row>
A 216        </el-card>
217
218      </el-col>
219      <el-col :span="17">
777422 220        <el-tabs type="border-card"  style="height: 600px" v-model="activeName">
b78728 221          <el-tab-pane name="first">
A 222            <span slot="label"> <a class="el-icon-date"></a>首页</span>
223            <el-col :span="24">
224              <el-table height="500" :cell-style="rowStyle" :data="formulaChildList">
225                <el-table-column label="拧紧步号" width="80" align="center" prop="stepSort">
226                </el-table-column>
227                <el-table-column label="操作内容" align="center" prop="operationSteps">
228                </el-table-column>
229                <el-table-column label="产品编号" width="80" align="center" prop="productCode">
230                </el-table-column>
231                <el-table-column label="物料编码" width="110" align="center" prop="materialCode">
232                </el-table-column>
233                <el-table-column label="采集值" align="center" prop="collectData">
234                </el-table-column>
235                <el-table-column label="结果" width="60" align="center" prop="results">
236                </el-table-column>
237
238              </el-table>
239            </el-col>
240          </el-tab-pane>
241        </el-tabs>
242      </el-col>
243    </el-row>
244   </div>
245 </template>
246 <script>
247 import {listWorkReport} from "@/api/main/om/workReport/workReport";
248 import {listStationConf,getIpv4} from "@/api/main/sc/stationConf";
249 import {
250   clearWorkpieceRelease,
251   fistSetpNumber, initializedData,
252   listFormulaChild,
253   noPageListFormulaChild,
254   releaseCheck, unfinishedProcess,
255   updateResults,
256   updateTighteningFormula,
257   workpieceRelease
258 } from "@/api/main/bs/formulaChild/formulaChild";
259 import MySerialPort from "@/utils/MySerialPort";
260 import USBDevice from "@/utils/usb.json";
261 import {
262   bindYzSfcFlag,
263   checkCarCode, checkYzSfcCode,
264   findBytrolleyYardGetOne,
265   listProductionOrde, mozuReceivingWorkOrders,
266   receivingWorkOrders,
267   trolleyYardBinDing
268 } from "@/api/main/om/productionOrde/productionOrde";
269 import {addPassingStationCollection} from "@/api/main/da/passingStationCollection/passingStationCollection";
270 import {
271   addBasicParameters,
272   addParamCollection,
273   addTighteningParameters,
274   saveCampaignTimeParameters,
275   replaceAssemblyCode, checkRecordDataDone,
276 } from "@/api/main/da/paramCollection/paramCollection";
277 import {addFormula} from "@/api/main/bs/formula/formula";
039f89 278 import QRCode from "qrcodejs2";
b78728 279
A 280 export default {
281   name: "stationTerminal",
282   data() {
283     return {
dd5d35 284       materialCode: '', // 物料编码
b78728 285       carCode: '',
A 286       showInput: false,
287       onLineBinDing: false,
288
289       serialPortContent: '',
290       // 查询参数
291       formulaChildParams: {
292         pageNum: 1,
293         pageSize: 10,
294         productCode: null,
295         processesCode: null,
296       },
297       // 配方配置子信息表格数据
298       formulaChildList: [],
299       ipAddress: '',
300       imgSrc: '',
301       headContent: {
302         processesCode: 'OP1010',
303         processesName: '贴标机-贴码',
304         sfcCode: '',
305         yzSfcCode: '',
306         cardCode: '',
307       },
308       workpieceInformation: {
309         workOrderNo: null,
310         productCode: null,
311         productModel: null,
312         productName: null,
313         inboundTime: null,
314         materialCode: null,
315         planQty: null,
316       },
317       // 查询参数
318       queryParams: {
319         pageNum: 1,
320         pageSize: 10,
321         sfcCode: null,
322       },
323       // 查询参数
324       StationConfQueryParams: {
325         pageNum: 1,
326         pageSize: 10,
327         ipAddress: null,
328       },
329       cakeLamp: {
330         plcState: 1, //plc
331         scannerState: 1, //扫码枪
332         InPlace: 0, //工件到位
333         scanFinish: 0,
334         startWork: 0,
335         release: 0 //允许放行
336       },
337       content: '',
5442bc 338       // url: "ws://10.103.210.248:8080/websocket/message/",
A 339       url: "ws://192.168.20.250:8080/websocket/message/",
b78728 340
A 341       passingStationForm: {},
342       originalArray: [],
777422 343       orderFlag: true,
039f89 344       printFlag: false,
777422 345       activeName: 'first',
A 346
b78728 347     }
d5a701 348   },
C 349   mounted() {
350     this.setFocus()
b78728 351   },
A 352   beforeDestroy() {
353     this.exit();
354   },
355   created() {
356     this.initStation();
357   },
358   computed: {
359     isDisable() {
360       return this.btnType === "danger";
361     },
362   },
363   methods: {
d5a701 364     setFocus(){
C 365       this.$nextTick(()=>{
366         this.$refs.inputData.focus()
367       })
368     },
777422 369     changeMenu(tab, event) {
A 370       console.log(tab, event);
371     },
dd5d35 372     handleEnter() {
3c3c4d 373       this.serialPortMethod(this.materialCode);
dd5d35 374       this.$message("扫描物料编码"+this.materialCode);
5b939f 375       this.setFocus();
C 376       this.materialCode="";
dd5d35 377     },
4280d7 378     // getWorkOrders(){
A 379     //   if(this.headContent.sfcCode === '' || this.headContent.sfcCode === null){
380     //     //接收工单
381     //     const param = {
382     //       lineCode: this.headContent.processesCode
383     //     }
384     //     mozuReceivingWorkOrders(param).then(response => {
385     //       this.headContent.sfcCode = response.msg;
386     //       this.queryParams.productNum = response.msg;
387     //       this.getList()
388     //       this.cakeLamp.scanFinish = 1
389     //       this.cakeLamp.startWork = 1
390     //       this.cakeLamp.InPlace = 1
391     //     });
392     //   }else {
393     //     this.$message.error("已经有工单了,不能接收!");
394     //   }
395     // },
b78728 396     serialLink() {
A 397       this.open1 = true
398     },
399     serialPortMethod(value){
400       let formulaChildParams = {
401         scanBarcode: value,
402         sfcBarcode: this.headContent.sfcCode,
403         workOrderNo: this.workpieceInformation.workOrderNo,
404         productCode: this.workpieceInformation.productCode,
405         locationCode: this.headContent.processesCode,
406         collectionTime: new Date()
407       }
408       updateResults(formulaChildParams).then(response => {
409         console.log(response)
410         if(response.msg === "3"){
411           this.cakeLamp.release= 1 //允许放行
412         }else if(response.msg === "2"){
413           this.$message.error('扫码重复请重新扫码!');
414         }
415         this.getListFormulaChild()
416       });
417     },
418     rowStyle({ row }) {
419       if (row.results === 'OK') {
420         return 'background-color: PaleGreen';
421       } else if (row.results === 'NG') {
422         return 'background-color: LightSalmon';
423       }
424       return '';
425     },
426     /** 查询配方配置子信息列表 */
427     getListFormulaChild() {
428       // this.formulaChildList = []
429       this.formulaChildParams.productCode = this.workpieceInformation.productCode
430       this.formulaChildParams.processesCode = this.headContent.processesCode
431       console.log(this.formulaChildParams)
432       noPageListFormulaChild(this.formulaChildParams).then(response => {
433         this.formulaChildList = response.rows;
434         if (this.formulaChildList.length >0){
435           let pos = 0
436           const tempArr = this.formulaChildList.filter(x=> 'OK' === x.results)
437           if (tempArr.length>0){
438             pos = tempArr.length
439             this.$nextTick(() => {
440               let temp33 = document.getElementsByClassName('el-table__row')
441               console.log('temp33',temp33)
442               console.log('len',temp33.item(pos))
443               if (temp33.length > 0){
444                 console.log('1111111111111111')
445                 let arr = temp33[pos-1]
446                 console.log('srr',arr)
447                 arr.scrollIntoView({ block: 'center' })
448               }
449             })
450           }
451
452         }
453
454       });
455     },
456     endClear(){
457       this.cakeLamp.InPlace= 0 //工件到位
458       this.cakeLamp.scanFinish= 0
459       this.cakeLamp.startWork= 0
460       this.cakeLamp.release= 0 //允许放行
461
462       this.formulaChildList = []
463       this.workpieceInformation.productCode = null;
464       this.workpieceInformation.workOrderNo = null;
465       this.workpieceInformation.productModel = null;
466       this.workpieceInformation.productName = null;
467       this.workpieceInformation.inboundTime = null;
468       this.headContent.sfcCode = '';
469       this.headContent.yzSfcCode = '';
470       this.headContent.cardCode = '';
777422 471       this.workpieceInformation.planQty = ''
b78728 472     },
A 473     clearClick(){
474       const param = {
475         workOrderNo: this.workpieceInformation.workOrderNo,
476         productCode: this.workpieceInformation.productCode,
477         locationCode: this.headContent.processesCode,
478         productBarcode: this.headContent.sfcCode,
479       }
039f89 480       // this.endClear()
b78728 481       clearWorkpieceRelease(param).then(response => {});
039f89 482       // this.headContent.sfcCode = ''
b78728 483       this.$message('清除成功!');
039f89 484       this.setFocus();
A 485       this.getList()
486
b78728 487     },
A 488     /** 查询工单列表 */
489     async getList() {
490       await listProductionOrde(this.queryParams).then(response => {
491         let rowsData = response.rows[0];
492         console.log(rowsData)
493         this.workpieceInformation.workOrderNo = rowsData.workOrderNo;
494         this.workpieceInformation.productCode = rowsData.productCode;
495         this.workpieceInformation.materialCode = rowsData.materialCode;
496         this.workpieceInformation.planQty = rowsData.planQty;
497         this.headContent.cardCode = rowsData.trolleyYard;
498       });
499       this.getListFormulaChild()
500       this.workpieceInformation.inboundTime = this.getCurrentTime()
4280d7 501
b78728 502     },
A 503
504     initializedData(){
505       const param = {
506         locationCode: this.headContent.processesCode,
507       }
508       initializedData(param).then(response => {
509         if(response.msg !== ''){
510           this.headContent.sfcCode = response.msg;
511           this.queryParams.productNum = response.msg;
512           this.getList()
513           this.cakeLamp.scanFinish = 1
514           this.cakeLamp.startWork = 1
515           this.cakeLamp.InPlace = 1
516         }
517       });
518     },
519
520     getCurrentTime() {
521       const now = new Date();
522       const year = now.getFullYear();
523       const month = this.padTimeUnit(now.getMonth() + 1); // 月份是从0开始的
524       const day = this.padTimeUnit(now.getDate());
525       const hours = this.padTimeUnit(now.getHours());
526       const minutes = this.padTimeUnit(now.getMinutes());
527       const seconds = this.padTimeUnit(now.getSeconds());
528       return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
529     },
530     padTimeUnit(value) {
531       return value.toString().padStart(2, '0');
532     },
533
534     exit() {
535       if (this.ws) {
536         this.ws.close();
537         this.ws = null;
538       }
539     },
039f89 540     test1(){
A 541       document.getElementById('canvasWrapper1').innerHTML = '';
542       this.$nextTick(() => {
543           let qrCode = new QRCode('canvasWrapper1',{
544             width: 83,
545             height: 83,
546             text: 'P9900166410#T'+ this.headContent.sfcCode +'#V993983#SSW002.005#HHW001.001#NMCU#',
547             colorDark: '#000',
548             colorLight: '#fff'
549           })
550         }
551       )
552     },
553     test2(){
554       document.getElementById('canvasWrapper2').innerHTML = '';
555       this.$nextTick(() => {
556           let qrCode = new QRCode('canvasWrapper2',{
557             width: 83,
558             height: 83,
559             text: 'P9900166410#T'+ this.headContent.sfcCode +'#V993983#SSW002.005#HHW001.001#NMCU#',
560             colorDark: '#000',
561             colorLight: '#fff'
562           })
563         }
564       )
565     },
b78728 566     send() {
A 567       if (this.ws) {
568         this.ws.send(this.message);
569       } else {
570         alert("未连接到服务器");
571       }
572     },
573
574     initStation: async function () {
575       await getIpv4().then(response => {
576         this.StationConfQueryParams.ipAddress = response.msg
577         console.log('查询到本工位IP为' + this.StationConfQueryParams.ipAddress)
578       });
579       await listStationConf(this.StationConfQueryParams).then(response => {
580         let rows = response.rows[0]
581         if (response.rows.length === 0) {
582           this.$message('该工位没有配置IP,请联系管理员配置IP');
583           return
584         }
585         this.headContent.processesName = rows.processesName
586         this.headContent.processesCode = rows.processesCode
587         this.initializedData()
039f89 588         if(this.headContent.processesCode === 'OP010'){
A 589           this.printFlag = true
590         }
b78728 591
A 592       });
593       console.log('websocket连接工位为' + this.headContent.processesCode)
594       const wsuri = this.url + this.headContent.processesCode;
595       this.ws = new WebSocket(wsuri);
596       const self = this;
597       this.ws.onopen = function (event) {
dd5d35 598         self.$message('websocket连接成功!');
b78728 599       };
A 600
601
602       //socket从后台向前台推送数据
603       this.ws.onmessage = function (event) {
039f89 604         if (event.data === "print") {
A 605           self.$message('postman调用打印方法打印!');
606           document.getElementById('print').click();
607         }else if (event.data === "IN") {
b78728 608           self.cakeLamp.InPlace = 1;
A 609         } else if (event.data === "OUT") {
610           self.cakeLamp.release = 1;
611         } else if (event.data === "END") {
612
613           const formulaChildIndex = self.formulaChildList.length-1
614
615           const orderParam = {
616             productNum: self.headContent.sfcCode,
617           }
618
619           if(self.headContent.sfcCode=== ''||self.headContent.sfcCode=== null){
620             self.$message('总成码为空,请扫码!')
621             unfinishedProcess({processesCode: self.headContent.processesCode,recordDataDone: 26}).then(response => {});
622             return;
623           }
624
625           if(self.formulaChildList[formulaChildIndex].results !== 'OK'){
626             self.$message('未做完工序禁止放行');
627             unfinishedProcess({processesCode: self.headContent.processesCode,recordDataDone: 25}).then(response => {});
628             return;
629           }
630
631
632           const param = {
633             workOrderNo: self.workpieceInformation.workOrderNo,
634             productCode: self.workpieceInformation.productCode,
635             locationCode: self.headContent.processesCode,
636             productBarcode: self.headContent.sfcCode,
637             inboundTime: self.workpieceInformation.inboundTime,
638             formulaChildEntity: self.formulaChildList[formulaChildIndex]
639           }
640
641           console.log("进入最终方法")
642           self.endSaveData(param)
643
fd4ea6 644         } else if(event.data.includes("productNum")){//产品序列号
b78728 645           let productNum = event.data.split(',')[1];
A 646           self.headContent.sfcCode = productNum;
647           self.queryParams.productNum = productNum;
648           self.getList()
649           self.cakeLamp.scanFinish = 1
650           self.cakeLamp.startWork = 1
651           self.cakeLamp.InPlace = 1
652
4280d7 653           const param = {
A 654             processesCode: self.headContent.processesCode,
655             productCode: self.workpieceInformation.productCode
656           }
657           fistSetpNumber(param).then(response => {
658             console.log("fistSetpNumber------"+response.msg)
659           });
039f89 660           self.test1()
A 661           self.test2()
4280d7 662
fd4ea6 663         }else if (event.data.includes("[")) {//拧紧
C 664           let formulaChilds = "";
665           self.formulaChildList.sort((a, b) => a.stepSort - b.stepSort);
666           self.formulaChildList
667             .filter((formulaChild) => formulaChild.operationType === '1');
668           for (let i = 0; i < self.formulaChildList.length; i++) {
669             let formulaChild = self.formulaChildList[i];
670             let results = formulaChild.results;
671
672             if (results === '' || results === null || results === 'NG') {
673               formulaChilds = formulaChild;
674               break;
675             }
676           }
677           if(formulaChilds === ""){
678             self.$message.error('本工位已工作完成!');
679             return;
680           }
681           const param = {
682             id: formulaChilds.id,
683             tightenTheArray: event.data,
684             paramCode: formulaChilds.paramCode,
685             workOrderNo: self.workpieceInformation.workOrderNo,
686             productCode: self.workpieceInformation.productCode,
687             locationCode: self.headContent.processesCode,
688             productBarcode: self.headContent.sfcCode,
689             spareField1: formulaChilds.spareField1,
690             spareField2: formulaChilds.spareField2,
691             spareField3: formulaChilds.spareField3,
692             spareField4: formulaChilds.spareField4,
693             stepSort: formulaChilds.stepSort,
694             ngTimes: formulaChilds.ngTimes,
695           }
696           if(formulaChilds.paramCode === null||formulaChilds.paramCode ===''){
697             self.$message('未找到参数码,请检查参数码是否正确');
698             return;
699           }
700           self.formulaChildParams.artificialNgFlag = null
701           console.log("self.formulaChildParams.artificialNgFlag"+self.formulaChildParams.artificialNgFlag)
702           if(self.headContent.sfcCode!==null||self.headContent.sfcCode!==''){
703             updateTighteningFormula(param).then(response => {
704               //addTighteningParameters(param).then(response => {});
705               self.getListFormulaChild()
706             }).catch(error =>{
707               self.getListFormulaChild()
708             });
709           }
b78728 710         }
A 711       };
712     },
713
714     endSaveData(param){
715       saveCampaignTimeParameters(param).then(response => {
716       this.cakeLamp.release = 1;
717       this.endClear()
718       workpieceRelease(param).then(response => {});
719       });
720     },
721   }
722 }
723
724 </script>
725 <style scoped>
039f89 726 .div1, .div2 {
A 727   flex: 1; /* 两个div平分容器宽度 */
728 }
729 .span{
730   font-family: 'Microsoft YaHei', sans-serif;
731 }
732 .div2{
733   margin-left: 30px;
734 }
b78728 735 .bottom-card{
A 736   height: 600px;
737 }
738 .circle-button{
739   height: 30px;
740   width: 30px;
741 }
742 .circle-red {
743   background-color: #e01a4f;
744 }
745 .circle-green {
746   background-color: green;
747 }
748 .circle-green-animate {
749   background-color: green;
750   animation: circle-green-animate 2s infinite;
751 }
752   @keyframes circle-green-animate {
753     50% {
754       opacity: 0.6;
755     }
756     0% {
757       opacity: 0.2;
758     }
759   }
760 .head-font{
761   /*font-weight: bold;*/
762   /*font-size: 25px;*/
763 }
764 span{
765   font-size: 15px;
766 }
767 .el-table .warning-row {
768   background: oldlace;
769 }
770
771 .el-table .success-row {
772   background: #f0f9eb;
773 }
774 </style>
775