From 4e91ae3c1ff41d0bf9f65d444c90c2583e69cdb7 Mon Sep 17 00:00:00 2001 From: admin <15939171744@163.com> Date: 星期五, 27 九月 2024 17:16:10 +0800 Subject: [PATCH] 下线打印报告优化 --- jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java | 48 ++++++++++++ jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/PrintOfflineReportInfo.java | 28 +++++++ jcdm-ui/src/views/main/cfkb/Instructions/index.vue | 98 ++++++++---------------- jcdm-ui/src/views/components/offlineQualificationReport.vue | 47 +++++------ jcdm-ui/src/api/main/da/paramCollection/paramCollection.js | 8 ++ 5 files changed, 139 insertions(+), 90 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/PrintOfflineReportInfo.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/PrintOfflineReportInfo.java new file mode 100644 index 0000000..00b55db --- /dev/null +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/PrintOfflineReportInfo.java @@ -0,0 +1,28 @@ +package com.jcdm.main.bs.formulaChild.domain; + +import lombok.Data; + +@Data +public class PrintOfflineReportInfo { + private String inspectionDate; + private String param18; + private String param19; + private String param20; + private String param21; + private String param22; + private String param23; + private String param24; + private String param25; + private String param26; + private String param27; + private String param28; + private String param29; + private String param30; + private String param31; + private String param32; + private String param33; + private String param34; + private String param35; + private String param36; + private String param37; +} diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java index dcd6c74..a3640e0 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java @@ -7,6 +7,7 @@ import com.jcdm.common.enums.BusinessType; import com.jcdm.common.utils.DateUtils; import com.jcdm.common.utils.poi.ExcelUtil; +import com.jcdm.main.bs.formulaChild.domain.PrintOfflineReportInfo; import com.jcdm.main.da.paramCollection.domain.DaParamCollection; import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService; import org.springframework.beans.factory.annotation.Autowired; @@ -14,7 +15,10 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.List; +import java.util.Map; /** * 璁惧浜у搧杩囩▼鍙傛暟閲囬泦Controller @@ -32,6 +36,50 @@ /** * 鏌ヨ璁惧浜у搧杩囩▼鍙傛暟閲囬泦鍒楄〃 */ + @GetMapping("/getPrintOfflineReportInfo") + public AjaxResult getPrintOfflineReportInfo(DaParamCollection daParamCollection) + { + PrintOfflineReportInfo info = new PrintOfflineReportInfo(); + info.setParam18("锛�500"); + info.setParam19("0.3%锛�0%锛�0.5%"); + info.setParam20("锛�600"); + info.setParam21("锛�700"); + info.setParam22("0.22"); + info.setParam23("362"); + info.setParam24("8.18"); + info.setParam25("0.1"); + info.setParam26("21.53,42.33,42.19"); + info.setParam27("49.20,49.34,49.15"); + info.setParam28("0.061%锛�0.163%锛�0.223%"); + info.setParam29("35.1,35.0,35.1"); + info.setParam30("鈭�"); + info.setParam31("0.0041"); + info.setParam32("3.06"); + info.setParam33("o.48"); + info.setParam34("4.7锝旳"); + info.setParam35("562.1"); + info.setParam36("-137.1"); + info.setParam37("鈭�"); + info.setInspectionDate(getInspectionDate()); + return AjaxResult.success(info); + } + + public static String getInspectionDate(){ + // 鑾峰彇褰撳墠鏃ユ湡 + LocalDate today = LocalDate.now(); + // 瀹氫箟鏃ユ湡鏍煎紡锛堝勾.鏈�.鏃ワ級 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.M.d"); + // 鏍煎紡鍖栧綋鍓嶆棩鏈� + return today.format(formatter); + } + + public static void main(String[] args) { + System.out.println(getInspectionDate()); + } + + /** + * 鏌ヨ璁惧浜у搧杩囩▼鍙傛暟閲囬泦鍒楄〃 + */ @PreAuthorize("@ss.hasPermi('main:paramCollection:list')") @GetMapping("/list") public TableDataInfo list(DaParamCollection daParamCollection) diff --git a/jcdm-ui/src/api/main/da/paramCollection/paramCollection.js b/jcdm-ui/src/api/main/da/paramCollection/paramCollection.js index f77c8db..15e2557 100644 --- a/jcdm-ui/src/api/main/da/paramCollection/paramCollection.js +++ b/jcdm-ui/src/api/main/da/paramCollection/paramCollection.js @@ -9,6 +9,14 @@ }) } +export function getPrintOfflineReportInfo(query) { + return request({ + url: '/main/paramCollection/getPrintOfflineReportInfo', + method: 'get', + params: query + }) +} + // 鏌ヨ璁惧浜у搧杩囩▼鍙傛暟閲囬泦璇︾粏 export function getParamCollection(id) { return request({ diff --git a/jcdm-ui/src/views/components/offlineQualificationReport.vue b/jcdm-ui/src/views/components/offlineQualificationReport.vue index 7f969d6..7bcdf28 100644 --- a/jcdm-ui/src/views/components/offlineQualificationReport.vue +++ b/jcdm-ui/src/views/components/offlineQualificationReport.vue @@ -18,7 +18,7 @@ <span>浜у搧鍚嶇О/闆堕儴浠跺彿锛氱數椹卞姩绯荤粺鎬绘垚/9900200461</span> </td> <td colspan="4"> - <span>妫�楠屾棩鏈燂細2024.9.4</span> + <span>妫�楠屾棩鏈燂細{{printParam.inspectionDate}}</span> </td> <td colspan="4"> <span>杩芥函缂栧彿锛�2409030000032</span> @@ -260,7 +260,7 @@ <td>A</td> <td>瀹氬瓙缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>锛�500</td> + <td>{{printParam.param18}}</td> <td>OK</td> <td></td> <td></td> @@ -273,7 +273,7 @@ <td>A</td> <td>瀹氬瓙缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>0.3%锛�0%锛�0.5%</td> + <td>{{printParam.param19}}</td> <td>OK</td> <td></td> <td></td> @@ -285,7 +285,7 @@ <td>A</td> <td>瀹氬瓙缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>锛�500</td> + <td>{{printParam.param20}}</td> <td>OK</td> <td></td> <td></td> @@ -297,7 +297,7 @@ <td>A</td> <td>瀹氬瓙缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>锛�500</td> + <td>{{printParam.param21}}</td> <td>OK</td> <td></td> <td></td> @@ -309,7 +309,7 @@ <td>A</td> <td>瀹氬瓙缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>0.22</td> + <td>{{printParam.param22}}</td> <td>OK</td> <td></td> <td></td> @@ -322,7 +322,7 @@ <td>A</td> <td>瀹氬瓙缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>362</td> + <td>{{printParam.param23}}</td> <td>OK</td> <td></td> <td></td> @@ -334,7 +334,7 @@ <td>A</td> <td>鏁存満缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>8.18</td> + <td>{{printParam.param24}}</td> <td>OK</td> <td></td> <td></td> @@ -346,7 +346,7 @@ <td>A</td> <td>鏁存満缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>0.1</td> + <td>{{printParam.param25}}</td> <td>OK</td> <td></td> <td></td> @@ -360,7 +360,7 @@ <td>A</td> <td>鏁存満缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>21.53,42.33,42.19</td> + <td>{{printParam.param26}}</td> <td>OK</td> <td></td> <td></td> @@ -373,7 +373,7 @@ <td>A</td> <td>鏁存満缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>49.20,49.34,49.15</td> + <td>{{printParam.param27}}</td> <td>OK</td> <td></td> <td></td> @@ -385,7 +385,7 @@ <td>A</td> <td>鏁存満缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>0.061%锛�0.163%锛�0.223%</td> + <td>{{printParam.param28}}</td> <td>OK</td> <td></td> <td></td> @@ -397,7 +397,7 @@ <td>A</td> <td>鏁存満缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>35.1,35.0,35.1</td> + <td>{{printParam.param29}}</td> <td>OK</td> <td></td> <td></td> @@ -409,7 +409,7 @@ <td>A</td> <td>缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>鈭�</td> + <td>{{printParam.param30}}</td> <td>OK</td> <td></td> <td></td> @@ -422,7 +422,7 @@ <td>A</td> <td>鏁存満缁煎悎娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>0.0041</td> + <td>{{printParam.param31}}</td> <td>OK</td> <td></td> <td></td> @@ -434,7 +434,7 @@ <td>A</td> <td>姘斿瘑娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>3.06</td> + <td>{{printParam.param32}}</td> <td>OK</td> <td></td> <td></td> @@ -446,7 +446,7 @@ <td>A</td> <td>姘斿瘑娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>o.48</td> + <td>{{printParam.param33}}</td> <td>OK</td> <td></td> <td></td> @@ -458,7 +458,7 @@ <td>A</td> <td>鐢垫�ц兘娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>4.7锝旳</td> + <td>{{printParam.param34}}</td> <td>OK</td> <td></td> <td></td> @@ -470,7 +470,7 @@ <td>A</td> <td>鐢垫�ц兘娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>562.1</td> + <td>{{printParam.param35}}</td> <td>OK</td> <td></td> <td></td> @@ -482,7 +482,7 @@ <td>A</td> <td>鏃嬪彉娴嬭瘯浠�</td> <td>鍏ㄦ</td> - <td>-137.1</td> + <td>{{printParam.param36}}</td> <td>OK</td> <td></td> <td></td> @@ -494,7 +494,7 @@ <td>A</td> <td>EOL娴嬭瘯</td> <td>鍏ㄦ</td> - <td>鈭�</td> + <td>{{printParam.param37}}</td> <td>OK</td> <td></td> <td></td> @@ -587,13 +587,12 @@ props: ['printParam'], data() { return { - printData: this.printParam } }, - created() { - console.log(this.printData) + mounted() { }, methods: { + } } diff --git a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue index 830f4a9..81f23b2 100644 --- a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue +++ b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue @@ -3,17 +3,17 @@ <el-row :gutter="5"> <el-col :span="7"> <el-card shadow="never"> - <span class="head-font">宸ヤ綅缂栧彿 : {{headContent.processesCode}}</span> + <span class="head-font">宸ヤ綅缂栧彿锛歿{headContent.processesCode}}</span> </el-card> </el-col> <el-col :span="7"> <el-card shadow="never"> - <span class="head-font">宸ヤ綅鍚嶇О : {{headContent.processesName}}</span> + <span class="head-font">宸ヤ綅鍚嶇О锛歿{headContent.processesName}}</span> </el-card> </el-col> <el-col :span="10"> - <el-card shadow="never"> - <span class="head-font">浜у搧搴忓垪鍙� :</span> + <el-card shadow="never" body-style="padding: 10px;"> + <span class="head-font">浜у搧搴忓垪鍙凤細</span> <el-input style="width: 50%;" v-model="headContent.sfcCode" placeholder="璇疯緭鍏ュ唴瀹�"></el-input> <!-- <el-button type="primary" id="print" v-print="'#printMe'">鎵撳嵃</el-button>--> <el-button type="primary" id="print" v-print="'#printMe'" style="display: none;">鎵撳嵃</el-button> @@ -31,7 +31,7 @@ <span slot="label"> <a class="el-icon-date"></a>棣栭〉</span> <el-col :span="24"> <div> - <div id="printMe" class="print_hide"> + <div id="printMe"> <offline-qualification-report :printParam="printParam"></offline-qualification-report> </div> </div> @@ -54,13 +54,14 @@ import USBDevice from "@/utils/usb.json"; import {addPassingStationCollection} from "@/api/main/da/passingStationCollection/passingStationCollection"; import { - addTighteningParameters, enterWeighing, + addTighteningParameters, enterWeighing, getPrintOfflineReportInfo, listParamCollection, replaceAssemblyCode, saveCampaignTimeParameters, yzAddBasicParameters, } from "@/api/main/da/paramCollection/paramCollection"; import QRCode from "qrcodejs2"; import OfflineQualificationReport from "@/views/components/offlineQualificationReport.vue"; +import {listProductionOrde} from "@/api/main/om/productionOrde/productionOrde"; export default { name: "stationTerminal", @@ -68,8 +69,7 @@ data() { return { printParam: { - key: '閫夐」1', - label: '榛勯噾绯�' + }, weightValue: '', showInput: true, @@ -159,52 +159,7 @@ // this.connectWebsocket(); // }, 3000); }, - mounted() { - if ("serial" in navigator) { - this.myserialport = new MySerialPort(); - this.getPorts(); - navigator.serial.addEventListener("connect", (e) => { - this.$message.success("璁惧宸茶繛鎺�"); - this.getPorts(); - }); - navigator.serial.addEventListener("disconnect", (e) => { - this.$message.error("璁惧宸叉柇寮�"); - }); - this.restaurants = this.loadAll(); - } else { - this.$message.error( - "褰撳墠涓篐TTP妯″紡鎴栬�呮祻瑙堝櫒鐗堟湰杩囦綆锛屼笉鏀寔缃戦〉杩炴帴涓插彛" - ); - } - }, - computed: { - isDisable() { - return this.btnType === "danger"; - }, - printContent() { - return { - // id: '', - // id: '#printMe', - // preview: false, - } - } - }, methods: { - - - enterWeighing(){ - if(this.headContent.sfcCode ==='' || this.weightValue === '' ){ - this.$message.error('鍙傛暟涓嶅叏锛�'); - }else { - let param = { - sfcCode: this.headContent.sfcCode, - weightValue: this.weightValue, - } - enterWeighing(param).then(response => { - this.$message('褰曞叆瀹屾垚锛�'); - }); - } - }, serialLink() { this.open1 = true }, @@ -222,17 +177,6 @@ } }, - Release(){ - // this.$message('portsList锛�'+this.portsList.length); - if(this.btnType === "danger"){ - this.$message('杩炴帴浜�!锛�'); - - }else { - this.$message('mei杩炴帴浜嗭紒'); - - } - - }, serialPortMethod(value){ let formulaChildParams = { scanBarcode: value, @@ -310,11 +254,22 @@ }, printBefore() { if (this.headContent.sfcCode !== '') { - document.getElementById('print').click(); + listProductionOrde({productNum: this.headContent.sfcCode}).then(response => { + let rowsData = response.rows[0]; + if(rowsData){ + getPrintOfflineReportInfo({productNum: this.headContent.sfcCode}).then(response => { + this.printParam = response.data + document.getElementById('print').click(); + }); + }else { + this.$message.error('绯荤粺娌℃湁姝ゅ伐鍗曪紝璇烽噸鏂版壂鐮侊紒'); + } + }); } else { - alert('璇峰厛鎵爜'); + this.$message.error('璇峰厛鎵爜!'); } }, + // print1() { // if(this.headContent.sfcCode !== ''){ // // 鏂板紑椤甸潰鎵撳嵃 @@ -721,5 +676,16 @@ .el-table .success-row { background: #f0f9eb; } + +/*闅愯棌鎵撳嵃鍖哄煙*/ +/*#printMe {*/ +/* display: none;*/ +/*}*/ +/*!*鎵撳嵃鏃舵樉绀烘墦鍗板尯鍩�*!*/ +/*@media print {*/ +/* #printMe {*/ +/* display: block;*/ +/* }*/ +/*}*/ </style> -- Gitblit v1.9.3