cl
2024-08-12 6f1a28c55c7744c471bd5edfee0a418fb0f23434
提交 | 用户 | 时间
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() {
6f1a28 373       if(this.headContent.sfcCode.includes("9900200461") || this.headContent.sfcCode.includes("9900207783")){
aba702 374         if(this.headContent.processesCode === "OP170" || this.headContent.processesCode === "OP180" ||
C 375            this.headContent.processesCode === "OP190" || this.headContent.processesCode === "OP200" ||
376            this.headContent.processesCode === "OP210" || this.headContent.processesCode === "OP220" ||
6f1a28 377           this.headContent.processesCode === "OP230"
c95d41 378         ){
C 379           this.headContent.sfcCode = this.materialCode;
380           this.queryParams.productNum = this.materialCode;
6f1a28 381           this.getList();
c95d41 382           this.cakeLamp.scanFinish = 1
C 383           this.cakeLamp.startWork = 1
384           this.cakeLamp.InPlace = 1
385           const param = {
386             processesCode: this.headContent.processesCode,
387             productCode: this.workpieceInformation.productCode
388           }
389           fistSetpNumber(param).then(response => {
390             console.log("fistSetpNumber------"+response.msg)
391           });
392         }
393       }
3c3c4d 394       this.serialPortMethod(this.materialCode);
dd5d35 395       this.$message("扫描物料编码"+this.materialCode);
5b939f 396       this.setFocus();
C 397       this.materialCode="";
dd5d35 398     },
4280d7 399     // getWorkOrders(){
A 400     //   if(this.headContent.sfcCode === '' || this.headContent.sfcCode === null){
401     //     //接收工单
402     //     const param = {
403     //       lineCode: this.headContent.processesCode
404     //     }
405     //     mozuReceivingWorkOrders(param).then(response => {
406     //       this.headContent.sfcCode = response.msg;
407     //       this.queryParams.productNum = response.msg;
408     //       this.getList()
409     //       this.cakeLamp.scanFinish = 1
410     //       this.cakeLamp.startWork = 1
411     //       this.cakeLamp.InPlace = 1
412     //     });
413     //   }else {
414     //     this.$message.error("已经有工单了,不能接收!");
415     //   }
416     // },
b78728 417     serialLink() {
A 418       this.open1 = true
419     },
420     serialPortMethod(value){
421       let formulaChildParams = {
422         scanBarcode: value,
423         sfcBarcode: this.headContent.sfcCode,
424         workOrderNo: this.workpieceInformation.workOrderNo,
425         productCode: this.workpieceInformation.productCode,
426         locationCode: this.headContent.processesCode,
427         collectionTime: new Date()
428       }
429       updateResults(formulaChildParams).then(response => {
430         console.log(response)
431         if(response.msg === "3"){
432           this.cakeLamp.release= 1 //允许放行
433         }else if(response.msg === "2"){
434           this.$message.error('扫码重复请重新扫码!');
435         }
436         this.getListFormulaChild()
437       });
438     },
439     rowStyle({ row }) {
440       if (row.results === 'OK') {
441         return 'background-color: PaleGreen';
442       } else if (row.results === 'NG') {
443         return 'background-color: LightSalmon';
444       }
445       return '';
446     },
447     /** 查询配方配置子信息列表 */
448     getListFormulaChild() {
449       // this.formulaChildList = []
450       this.formulaChildParams.productCode = this.workpieceInformation.productCode
451       this.formulaChildParams.processesCode = this.headContent.processesCode
452       console.log(this.formulaChildParams)
453       noPageListFormulaChild(this.formulaChildParams).then(response => {
454         this.formulaChildList = response.rows;
455         if (this.formulaChildList.length >0){
456           let pos = 0
457           const tempArr = this.formulaChildList.filter(x=> 'OK' === x.results)
458           if (tempArr.length>0){
459             pos = tempArr.length
460             this.$nextTick(() => {
461               let temp33 = document.getElementsByClassName('el-table__row')
462               console.log('temp33',temp33)
463               console.log('len',temp33.item(pos))
464               if (temp33.length > 0){
465                 console.log('1111111111111111')
466                 let arr = temp33[pos-1]
467                 console.log('srr',arr)
468                 arr.scrollIntoView({ block: 'center' })
469               }
470             })
471           }
472
473         }
474
475       });
476     },
477     endClear(){
478       this.cakeLamp.InPlace= 0 //工件到位
479       this.cakeLamp.scanFinish= 0
480       this.cakeLamp.startWork= 0
481       this.cakeLamp.release= 0 //允许放行
482
483       this.formulaChildList = []
484       this.workpieceInformation.productCode = null;
485       this.workpieceInformation.workOrderNo = null;
486       this.workpieceInformation.productModel = null;
487       this.workpieceInformation.productName = null;
488       this.workpieceInformation.inboundTime = null;
489       this.headContent.sfcCode = '';
490       this.headContent.yzSfcCode = '';
491       this.headContent.cardCode = '';
777422 492       this.workpieceInformation.planQty = ''
b78728 493     },
A 494     clearClick(){
495       const param = {
496         workOrderNo: this.workpieceInformation.workOrderNo,
497         productCode: this.workpieceInformation.productCode,
498         locationCode: this.headContent.processesCode,
499         productBarcode: this.headContent.sfcCode,
500       }
039f89 501       // this.endClear()
b78728 502       clearWorkpieceRelease(param).then(response => {});
039f89 503       // this.headContent.sfcCode = ''
b78728 504       this.$message('清除成功!');
039f89 505       this.setFocus();
A 506       this.getList()
507
b78728 508     },
A 509     /** 查询工单列表 */
510     async getList() {
511       await listProductionOrde(this.queryParams).then(response => {
512         let rowsData = response.rows[0];
513         console.log(rowsData)
514         this.workpieceInformation.workOrderNo = rowsData.workOrderNo;
515         this.workpieceInformation.productCode = rowsData.productCode;
516         this.workpieceInformation.materialCode = rowsData.materialCode;
517         this.workpieceInformation.planQty = rowsData.planQty;
518         this.headContent.cardCode = rowsData.trolleyYard;
519       });
520       this.getListFormulaChild()
521       this.workpieceInformation.inboundTime = this.getCurrentTime()
4280d7 522
b78728 523     },
A 524
525     initializedData(){
526       const param = {
527         locationCode: this.headContent.processesCode,
528       }
529       initializedData(param).then(response => {
530         if(response.msg !== ''){
531           this.headContent.sfcCode = response.msg;
532           this.queryParams.productNum = response.msg;
533           this.getList()
534           this.cakeLamp.scanFinish = 1
535           this.cakeLamp.startWork = 1
536           this.cakeLamp.InPlace = 1
537         }
538       });
539     },
540
541     getCurrentTime() {
542       const now = new Date();
543       const year = now.getFullYear();
544       const month = this.padTimeUnit(now.getMonth() + 1); // 月份是从0开始的
545       const day = this.padTimeUnit(now.getDate());
546       const hours = this.padTimeUnit(now.getHours());
547       const minutes = this.padTimeUnit(now.getMinutes());
548       const seconds = this.padTimeUnit(now.getSeconds());
549       return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
550     },
551     padTimeUnit(value) {
552       return value.toString().padStart(2, '0');
553     },
554
555     exit() {
556       if (this.ws) {
557         this.ws.close();
558         this.ws = null;
559       }
560     },
039f89 561     test1(){
A 562       document.getElementById('canvasWrapper1').innerHTML = '';
563       this.$nextTick(() => {
564           let qrCode = new QRCode('canvasWrapper1',{
565             width: 83,
566             height: 83,
567             text: 'P9900166410#T'+ this.headContent.sfcCode +'#V993983#SSW002.005#HHW001.001#NMCU#',
568             colorDark: '#000',
569             colorLight: '#fff'
570           })
571         }
572       )
573     },
574     test2(){
575       document.getElementById('canvasWrapper2').innerHTML = '';
576       this.$nextTick(() => {
577           let qrCode = new QRCode('canvasWrapper2',{
578             width: 83,
579             height: 83,
580             text: 'P9900166410#T'+ this.headContent.sfcCode +'#V993983#SSW002.005#HHW001.001#NMCU#',
581             colorDark: '#000',
582             colorLight: '#fff'
583           })
584         }
585       )
586     },
b78728 587     send() {
A 588       if (this.ws) {
589         this.ws.send(this.message);
590       } else {
591         alert("未连接到服务器");
592       }
593     },
594
595     initStation: async function () {
596       await getIpv4().then(response => {
597         this.StationConfQueryParams.ipAddress = response.msg
598         console.log('查询到本工位IP为' + this.StationConfQueryParams.ipAddress)
599       });
600       await listStationConf(this.StationConfQueryParams).then(response => {
601         let rows = response.rows[0]
602         if (response.rows.length === 0) {
603           this.$message('该工位没有配置IP,请联系管理员配置IP');
604           return
605         }
606         this.headContent.processesName = rows.processesName
607         this.headContent.processesCode = rows.processesCode
608         this.initializedData()
039f89 609         if(this.headContent.processesCode === 'OP010'){
A 610           this.printFlag = true
611         }
b78728 612
A 613       });
614       console.log('websocket连接工位为' + this.headContent.processesCode)
615       const wsuri = this.url + this.headContent.processesCode;
616       this.ws = new WebSocket(wsuri);
617       const self = this;
618       this.ws.onopen = function (event) {
dd5d35 619         self.$message('websocket连接成功!');
b78728 620       };
A 621
622
623       //socket从后台向前台推送数据
624       this.ws.onmessage = function (event) {
039f89 625         if (event.data === "print") {
A 626           self.$message('postman调用打印方法打印!');
627           document.getElementById('print').click();
628         }else if (event.data === "IN") {
b78728 629           self.cakeLamp.InPlace = 1;
A 630         } else if (event.data === "OUT") {
631           self.cakeLamp.release = 1;
632         } else if (event.data === "END") {
633
634           const formulaChildIndex = self.formulaChildList.length-1
635
636           const orderParam = {
637             productNum: self.headContent.sfcCode,
638           }
639
640           if(self.headContent.sfcCode=== ''||self.headContent.sfcCode=== null){
641             self.$message('总成码为空,请扫码!')
642             unfinishedProcess({processesCode: self.headContent.processesCode,recordDataDone: 26}).then(response => {});
643             return;
644           }
645
646           if(self.formulaChildList[formulaChildIndex].results !== 'OK'){
647             self.$message('未做完工序禁止放行');
648             unfinishedProcess({processesCode: self.headContent.processesCode,recordDataDone: 25}).then(response => {});
649             return;
650           }
651
652
653           const param = {
654             workOrderNo: self.workpieceInformation.workOrderNo,
655             productCode: self.workpieceInformation.productCode,
656             locationCode: self.headContent.processesCode,
657             productBarcode: self.headContent.sfcCode,
658             inboundTime: self.workpieceInformation.inboundTime,
659             formulaChildEntity: self.formulaChildList[formulaChildIndex]
660           }
661
662           console.log("进入最终方法")
663           self.endSaveData(param)
664
fd4ea6 665         } else if(event.data.includes("productNum")){//产品序列号
b78728 666           let productNum = event.data.split(',')[1];
A 667           self.headContent.sfcCode = productNum;
668           self.queryParams.productNum = productNum;
669           self.getList()
670           self.cakeLamp.scanFinish = 1
671           self.cakeLamp.startWork = 1
672           self.cakeLamp.InPlace = 1
673
4280d7 674           const param = {
A 675             processesCode: self.headContent.processesCode,
676             productCode: self.workpieceInformation.productCode
677           }
678           fistSetpNumber(param).then(response => {
679             console.log("fistSetpNumber------"+response.msg)
680           });
c95d41 681
C 682           //打印
683           if(self.headContent.processesCode === "OP165"){
684             self.test1()
685             self.test2()
686           }
4280d7 687
fd4ea6 688         }else if (event.data.includes("[")) {//拧紧
C 689           let formulaChilds = "";
690           self.formulaChildList.sort((a, b) => a.stepSort - b.stepSort);
691           self.formulaChildList
692             .filter((formulaChild) => formulaChild.operationType === '1');
693           for (let i = 0; i < self.formulaChildList.length; i++) {
694             let formulaChild = self.formulaChildList[i];
695             let results = formulaChild.results;
696
697             if (results === '' || results === null || results === 'NG') {
698               formulaChilds = formulaChild;
699               break;
700             }
701           }
702           if(formulaChilds === ""){
703             self.$message.error('本工位已工作完成!');
704             return;
705           }
706           const param = {
707             id: formulaChilds.id,
708             tightenTheArray: event.data,
709             paramCode: formulaChilds.paramCode,
710             workOrderNo: self.workpieceInformation.workOrderNo,
711             productCode: self.workpieceInformation.productCode,
712             locationCode: self.headContent.processesCode,
713             productBarcode: self.headContent.sfcCode,
714             spareField1: formulaChilds.spareField1,
715             spareField2: formulaChilds.spareField2,
716             spareField3: formulaChilds.spareField3,
717             spareField4: formulaChilds.spareField4,
718             stepSort: formulaChilds.stepSort,
719             ngTimes: formulaChilds.ngTimes,
720           }
721           if(formulaChilds.paramCode === null||formulaChilds.paramCode ===''){
722             self.$message('未找到参数码,请检查参数码是否正确');
723             return;
724           }
725           self.formulaChildParams.artificialNgFlag = null
726           console.log("self.formulaChildParams.artificialNgFlag"+self.formulaChildParams.artificialNgFlag)
727           if(self.headContent.sfcCode!==null||self.headContent.sfcCode!==''){
728             updateTighteningFormula(param).then(response => {
729               //addTighteningParameters(param).then(response => {});
730               self.getListFormulaChild()
731             }).catch(error =>{
732               self.getListFormulaChild()
733             });
734           }
b78728 735         }
A 736       };
737     },
738
739     endSaveData(param){
740       saveCampaignTimeParameters(param).then(response => {
741       this.cakeLamp.release = 1;
742       this.endClear()
743       workpieceRelease(param).then(response => {});
744       });
745     },
746   }
747 }
748
749 </script>
750 <style scoped>
039f89 751 .div1, .div2 {
A 752   flex: 1; /* 两个div平分容器宽度 */
753 }
754 .span{
755   font-family: 'Microsoft YaHei', sans-serif;
756 }
757 .div2{
758   margin-left: 30px;
759 }
b78728 760 .bottom-card{
A 761   height: 600px;
762 }
763 .circle-button{
764   height: 30px;
765   width: 30px;
766 }
767 .circle-red {
768   background-color: #e01a4f;
769 }
770 .circle-green {
771   background-color: green;
772 }
773 .circle-green-animate {
774   background-color: green;
775   animation: circle-green-animate 2s infinite;
776 }
777   @keyframes circle-green-animate {
778     50% {
779       opacity: 0.6;
780     }
781     0% {
782       opacity: 0.2;
783     }
784   }
785 .head-font{
786   /*font-weight: bold;*/
787   /*font-size: 25px;*/
788 }
789 span{
790   font-size: 15px;
791 }
792 .el-table .warning-row {
793   background: oldlace;
794 }
795
796 .el-table .success-row {
797   background: #f0f9eb;
798 }
799 </style>
800