From 9a85ad47505713fd99b6a0eaffb5f4a0e57fd233 Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期四, 16 十一月 2023 16:29:37 +0800 Subject: [PATCH] s --- src/views/quality/finishedProductInspection/finishedProducter-print.vue | 360 +++++++++++++++++++++++++++++++++++++++++++-------- vue.config.js | 4 src/views/quality/finishedProductInspection/index.vue | 13 + 3 files changed, 315 insertions(+), 62 deletions(-) diff --git a/src/views/quality/finishedProductInspection/finishedProducter-print.vue b/src/views/quality/finishedProductInspection/finishedProducter-print.vue index afe65a7..ed0ed6f 100644 --- a/src/views/quality/finishedProductInspection/finishedProducter-print.vue +++ b/src/views/quality/finishedProductInspection/finishedProducter-print.vue @@ -1,6 +1,6 @@ <template> - <div id="20230721_24921" align=center x:publishsource="Excel" style="margin-top: 20pt;"> - <table border=0 cellpadding=0 cellspacing=0 width=1194 style='border-collapse:collapse;table-layout:fixed;width:607pt'> + <div id="20230721_24921" align=center x:publishsource="Excel" style="margin-top: 60pt;margin-left: 20pt;"> + <table border=0 cellpadding=0 cellspacing=0 width=1194 style='border-collapse:collapse;table-layout:fixed;width:629pt'> <tr class=xl6524921 height=20 style='mso-height-source:userset;height:30.0pt'> <td colspan=3 rowspan=2 height=40 width=122 style='width:150pt;border: 1pt solid windowtext'> <span style='mso-ignore:vglayout;margin-left:12px;margin-top:14px;width:104px;height:42px'> @@ -12,55 +12,62 @@ <td rowspan=2 colspan=3 class=xl6824921 width=235 style='width:126pt' >鐗堟湰鍙�: A/0</td> </tr> <tr class=xl6524921 height=33 style='mso-height-source:userset;height:25.05pt'> - <td colspan=6 height=33 class=xl6624921 style='border-right:.5pt solid black; - height:25.05pt;border-left:none'>璁板綍缂栧彿:ZTT/QR-8.6-05锛圓/0)</td> - <td colspan=3 class=xl6624921 style='border-top:none;border-left:none'>褰掓。閮ㄩ棬:璐ㄩ噺淇濊瘉閮�</td> + <td colspan=6 height=33 class=xl6624921 style='border-right:.5pt solid black;height:25.05pt;border-left:none'> + 璁板綍缂栧彿:ZTT/QR-8.6-05锛圓/0) + </td> + <td colspan=3 class=xl6624921 style='border-top:none;border-left:none'> + 褰掓。閮ㄩ棬:璐ㄩ噺淇濊瘉閮� + </td> <td colspan=2 class=xl6824921 style='border-top:none'></td> </tr> <tr class=xl6524921 height=33 style='mso-height-source:userset;height:25.05pt'> - <td colspan=16 height=33 class=xl7424921 width=1194 style='height:25.05pt; - width:897pt'>杩炴帴鍣ㄥ強鎴愬搧妫�楠岃褰曡〃</td> + <td colspan=16 height=33 class=xl7424921 width=1194 style='height:25.05pt; width:897pt'> + 杩炴帴鍣ㄥ強鎴愬搧妫�楠岃褰曡〃 + </td> </tr> <tr class=xl6524921 height=53 style='mso-height-source:userset;height:40.05pt'> - <td colspan=2 height=53 class=xl7624921 style='border-right:.5pt solid black; - height:40.05pt'>椤圭洰鍚嶇О:</td> - <td colspan=5 class=xl6624921 style='border-right:.5pt solid black; - border-left:none'>銆� - <p class="MsoNormal" align="center" style="text-align:center"> - <span lang="EN-US" style="font-family:"Arial",sans-serif" v-text="deviceStr"></span></p> + <td colspan=2 height=53 class=xl7624921 style='border-right:.5pt solid black; height:40.05pt'> + 椤圭洰鍚嶇О: + </td> + <td colspan=5 class=xl6624921 style='border-right:.5pt solid black; border-left:none'>銆� + <p class="MsoNormal" align="center" style="text-align:center"> + <span lang="EN-US" style="font-family:"Arial",sans-serif" v-text="deviceStr"></span> + </p> </td> <td colspan=2 class=xl6924921 style='border-top:none;border-left:none'>妫�楠屼緷鎹�:</td> - <td colspan=7 class=xl6624921 style='border-right:.5pt solid black; - border-left:none'> + <td colspan=7 class=xl6624921 style='border-right:.5pt solid black; border-left:none'> 銆� </td> </tr> <tr class=xl6524921 height=53 style='mso-height-source:userset;height:40.05pt'> - <td colspan=2 height=53 class=xl7624921 style='border-right:.5pt solid black; - height:40.05pt'>浜у搧鍚嶇О:</td> - <td colspan=4 class=xl6624921 style='border-right:.5pt solid black; - border-left:none'> - <p class="MsoNormal" align="center" style="text-align:center"> - <span lang="EN-US" style="font-family:"Arial",sans-serif" v-text="product"></span></p> - </td> + <td colspan=2 height=53 class=xl7624921 style='border-right:.5pt solid black; height:40.05pt'> + 浜у搧鍚嶇О: + </td> + <td colspan=4 class=xl6624921 style='border-right:.5pt solid black; border-left:none'> + <p class="MsoNormal" align="center" style="text-align:center"> + <span lang="EN-US" style="font-family:"Arial",sans-serif" v-text="product"></span> + </p> + </td> <td colspan=2 class=xl6924921 style='border-top:none;border-left:none'>浜у搧鍨嬪彿:</td> - <td colspan=3 class=xl6624921 style='border-right:.5pt solid black; - border-left:none'> - <p class="MsoNormal" align="center" style="text-align:center"> - <span lang="EN-US" style="font-family:"Arial",sans-serif" v-text="typedata"></span></p> + <td colspan=3 class=xl6624921 style='border-right:.5pt solid black; border-left:none'> + <p class="MsoNormal" align="center" style="text-align:center"> + <span lang="EN-US" style="font-family:"Arial",sans-serif" v-text="typedata"></span> + </p> </td> <td colspan=2 class=xl6924921 style='border-top:none;border-left:none'>浜у搧鏁伴噺:</td> - <td colspan=3 class=xl6624921 style='border-right:.5pt solid black; - border-left:none'> + <td colspan=3 class=xl6624921 style='border-right:.5pt solid black; border-left:none'> <p class="MsoNormal" align="center" style="text-align:center"> - <span lang="EN-US" style="font-family:"Arial",sans-serif" v-text="number"></span></p> + <span lang="EN-US" style="font-family:"Arial",sans-serif" v-text="number"></span> + </p> </td> </tr> <tr class=xl6524921 height=53 style='mso-height-source:userset;height:40.05pt'> - <td colspan=2 height=53 class=xl7624921 style='border-right:.5pt solid black; - height:40.05pt'>妫�楠屽唴瀹�:</td> - <td colspan=14 class=xl6624921 style='border-right:.5pt solid black; - border-left:none'>妫�楠岀粨鏋�</td> + <td colspan=2 height=53 class=xl7624921 style='border-right:.5pt solid black; height:40.05pt'> + 妫�楠屽唴瀹�: + </td> + <td colspan=14 class=xl6624921 style='border-right:.5pt solid black; border-left:none'> + 妫�楠岀粨鏋� + </td> </tr> <tr class=xl6524921 height=53 style='mso-height-source:userset;height:40.05pt'> @@ -78,9 +85,11 @@ </td> </tr> + + <tbody v-for="(item,index) in prjdata" :key="index"> - <tr class=xl6524921 height=53 style='mso-height-source:userset;height:40.05pt'> - <td rowspan=3 height=53 class=xl7624921 style='border-right:.5pt solid black; height:40.05pt'> + <tr class=xl6524921 height=53 style='mso-height-source:userset;height:40.05pt'> + <td rowspan=16 height=53 class=xl7624921 style='border-right:.5pt solid black; height:40.05pt'> <p class="MsoNormal" align="center" style="text-align:center"> <span style="font-family:瀹嬩綋">{{item.father}}</span> </p> @@ -91,36 +100,34 @@ <td colspan=1 class=xl6624921 style='border-right:.5pt solid black;border-left:none'> <span style="font-family:瀹嬩綋">{{item.children[0].required}}</span> </td> - <td colspan=1 class=xl6624921 style='border-right:.5pt solid black;border-left:none'> - <span style="font-family:瀹嬩綋">{{item.children[0].inspectionValue}}</span> + <td colspan=1 v-for="(val,index) in item.children[0].testValueList" class=xl6624921 style='border-right:.5pt solid black;border-left:none'> + <span style="font-family:瀹嬩綋">{{val}}</span> </td> + <td colspan=2 class=xl6624921 style='border-right:.5pt solid black; border-left:none'> - <p v-if="item.children[0].testState==1" class="MsoNormal" align="center" style="text-align:center"> + <p v-if="item.children[0].iresult ==1" class="MsoNormal" align="center" style="text-align:center"> <span lang="EN-US" style="font-family:"Arial",sans-serif">鍚堟牸</span></p> - <p v-else class="MsoNormal" align="center" style="text-align:center"> + <p v-if="item.children[0].iresult ==0" class="MsoNormal" align="center" style="text-align:center"> <span lang="EN-US" style="font-family:"Arial",sans-serif">涓嶅悎鏍�</span></p> </td> </tr> <tr class=xl6524921 height=53 v-for="(el,index) in (item.children.slice(1))" :key="index" style='mso-height-source:userset;height:40.05pt'> - <!-- <td rowspan=3 height=53 class=xl7624921 style='border-right:.5pt solid black; height:40.05pt'> - <p class="MsoNormal" align="center" style="text-align:center"> - <span style="font-family:瀹嬩綋"></span> - </p> - </td> --> <td colspan=2 class=xl6624921 style='border-right:.5pt solid black;border-left:none'> <span style="font-family:瀹嬩綋">{{el.iname}}</span> </td> <td colspan=1 class=xl6624921 style='border-right:.5pt solid black;border-left:none'> <span style="font-family:瀹嬩綋">{{el.required}}</span> </td> - <td colspan=1 class=xl6624921 style='border-right:.5pt solid black;border-left:none'> - <span style="font-family:瀹嬩綋">{{el.inspectionValue}}</span> + <td colspan=1 v-for="(testValue,index) in el.testValueList" class=xl6624921 style='border-right:.5pt solid black;border-left:none'> + <span style="font-family:瀹嬩綋">{{testValue}}</span> </td> <td colspan=2 class=xl6624921 style='border-right:.5pt solid black; border-left:none'> - <p v-if="el.testState==1" class="MsoNormal" align="center" style="text-align:center"> + <p v-if="el.iresult==1" class="MsoNormal" align="center" style="text-align:center"> <span lang="EN-US" style="font-family:"Arial",sans-serif">鍚堟牸</span></p> - <p v-else class="MsoNormal" align="center" style="text-align:center"> + <p v-if="el.iresult==0" class="MsoNormal" align="center" style="text-align:center"> <span lang="EN-US" style="font-family:"Arial",sans-serif">涓嶅悎鏍�</span></p> + <!-- <p v-else class="MsoNormal" align="center" style="text-align:center"> + <span lang="EN-US" style="font-family:"Arial",sans-serif"></span></p> --> </td> </tr> </tbody> @@ -536,6 +543,83 @@ <td width=235 style='width:176pt'></td> </tr> </table> + + <template> + <div style="margin-top: 100pt;width: 75%;"> + <div class="head"> + <div class="head-1"> + <img width=174 height=58 src="../../../../public/img/image002.png"> + </div> + <div class="head-2"> + <p><span style="font-size:18pt;font-family:瀹嬩綋;margin-right: 70pt;">涓ぉ娴锋磱绯荤粺鏈夐檺鍏徃</span></p> + <span style="font-size:12pt;font-family:瀹嬩綋;margin-right: 70pt;">ZHONGTIAN TECHNOLOGY MARINE SYSTEMS Co.,LTD.</span> + </div> + </div> + <div class="bodycss"> + <div class="bodycs"> + <p class=x1111111><span>妫� 娴� 鎶� 鍛�<br> + <span class=x1111112 >Test Report</span><br> + <p style=" border-top: 1px solid black;width: 96%;margin-top: -1px;"></p> + </span></p> + </div> + <div class="bodycs-1"> + <p style="margin-left: 40px;"><span style="font-size:12pt;font-family:榛戜綋">鎶ュ憡缂栧彿:锛圢o锛�:ZTMS01-<br>Report No.锛�</span></p> + <p style="margin-left: 350px;"><span style="font-size:12pt;font-family:榛戜綋">鎶ュ憡鏃ユ湡<br> Report Date</span></p> + <p style="margin-left: 180px;"><span style="font-size:12pt;font-family:榛戜綋">椤垫锛�1/8<br> Page</span></p> + </div> + <div> + <div class="bodycs-2"> + <p ><span class=x1111112 style='margin-left: 40px;'>妫�楠岄」鐩�:<br> Test Item</span></p> + <p v-for="pel in prjdata"><span class="ziti">{{pel.father}}</span><br><span style="display: block;height: 2px; width: 500px; background: rgb(20, 20, 22);margin-left: 80px;"></span></span></p> + </div> + <div class="bodycs-3"> + <p ><span class=x1111112 style='margin-left: 36px;'>鏍峰搧鍚嶇О:<br>Description</span></p> + <p ><span class="ziti">{{material}}</span><br><span style="display: block;height: 2px; width: 500px; background: rgb(20, 20, 22);margin-left: 75px;"></span></span></p> + </div> + <div class="bodycs-3"> + <p ><span class=x1111112 style='margin-left: 36px;'>瑙勬牸鍨嬪彿:<br>Mode Type</span></p> + <p ><span class="ziti">{{materialCode}}</span><br><span style="display: block;height: 2px; width: 500px; background: rgb(20, 20, 22);margin-left: 75px;"></span></span></p> + </div> + <div class="bodycs-3"> + <p ><span class=x1111112 style='margin-left: 36px;'>鏍峰搧鏁伴噺:<br>Quantity</span></p> + <p v-for="pel in prjdata"><span class="ziti">{{quantity}}</span><br><span style="display: block;height: 2px; width: 500px; background: rgb(20, 20, 22);margin-left: 75px;"></span></span></p> + </div> + <div class="bodycs-3"> + <p ><span class=x1111112 style='margin-left: 36px;'>妫�楠岀被鍒�:<br>Type of Test</span></p> + <p v-for="pel in prjdata"><span class="ziti">浜у搧妫�楠�</span><br><span style="display: block;height: 2px; width: 500px; background: rgb(20, 20, 22);margin-left: 75px;"></span></span></p> + </div> + <div> + <div class="chilen"> + <p ><span class="x1111113">鎵� 鍑�:<br>Approved by</span></p> + <p v-for="pel in prjdata"><span class="ziti"></span><br><span style="display: block;height: 2px; width: 300px; background: rgb(20, 20, 22);margin-left: 75px;"></span></span></p> + </div> + <div class="chilen"> + <p ><span class="x1111113">鏍搁獙鍛�:<br>Inspected by</span></p> + <p v-for="pel in prjdata"><span class="ziti"></span><br><span style="display: block;height: 2px; width: 300px; background: rgb(20, 20, 22);margin-left: 75px;"></span></span></p> + </div> + <div style="display: flex;margin-left: 290px;"> + <p ><span class="x1111113">妫�楠屽憳锛�<br>Tested by</span></p> + <p v-for="pel in prjdata"><span class="ziti"></span><br><span style="display: block;height: 2px; width: 300px; background: rgb(20, 20, 22);margin-left: 75px;"></span></span></p> + </div> + <div class="cldata"> + <p ><span class="x1111113">閫佹牱鏃ユ湡:<br>Delivery Date</span></p> + <p v-for="pel in prjdata"><span class="ziti"></span><br><span style="display: block;height: 2px; width: 300px; background: rgb(20, 20, 22);margin-left: 75px;"></span></span></p> + </div> + <div class="cldata"> + <p ><span class="x1111113">娴嬭瘯鏃ユ湡:<br>Testing Date</span></p> + <p v-for="pel in prjdata"><span class="ziti"></span><br><span style="display: block;height: 2px; width: 300px; background: rgb(20, 20, 22);margin-left: 75px;"></span></span></p> + </div> + </div> + </div> + </div> + <div class="pagefooting"> + <p><span style="font-size:8pt;font-family:瀹嬩綋;color: 0, 32, 96;"> + 鍦板潃:姹熻嫃鐪佸崡閫氬競缁忔祹鎶�鏈紑鍙戝尯鏂板紑鍗楄矾1鍙�(226010) 鐢佃瘽:051389191125 浼犵湡:051389191123 + <br>Add: No 1 Xinkainan Road, NETDZ Nantong, Jiangsu, China (226010); TEL: 051389191125 ; Fax:051389191123 + </span></p> + </div> + </div> + </template> </div> </template> @@ -561,42 +645,100 @@ typedata:null, num:null, prjdata:[], + material:null, + materialCode:null, + quantity:null, } }, created(){ this.tableData = this.formData - console.log("============",this.tableData) this.initData() - // this.initProjectList(this.projectList) + this.initprjdata(this.prjdata) }, methods:{ initData(){ + console.log("<------------------------------->"); this.deviceStr = this.tableData.projectName this.product = this.tableData.material this.number = this.tableData.quantity this.typedata = this.tableData.specs + this.material = this.tableData.material + this.materialCode = this.tableData.materialCode + this.quantity = this.tableData.quantity + console.log(this.tableData,"--------------------11111"); this.tableData.children.forEach(el =>{ + console.log(el,"-->-->"); this.prjdata.push(el) - console.log("-----",this.prjdata); }) - }, + initprjdata(list){ + console.log(list,"uuuuuuuuuuuuuuuuu"); + const data = { + eId: '', + ename: '', + iname: '', + inote: '', + inspectionValue: '', + iresult: '', + required: '', + iunit: '', + itype: '', + testValueList: new Array(9) + } + if(list && list.length<2){ + list.forEach(item=>{ + if(item.children && item.children.length < 7){ + let size = 15 - item.children.length + for(let j=0;j<item.children.length;j++){ + let arr = [] + if(item.children[j].inspectionValue){ + arr = item.children[j].inspectionValue.split(",") + } + item.children[j].testValueList = arr + if(item.children[0].testValueList.length<12){ + let num = 9 - item.children[j].testValueList.length + for(let i=0;i<num;i++){ + item.children[j].testValueList.push("") + } + } + } + for(let i=0;i< size;i++){ + item.children.push(data) + item.father + } + } + }) + }else{ + let size = 0 + list.forEach(item=>{ + if(item.children){ + size+=item.children.length + } + }) + if(size<15){ + let num = 15 - size + for(let i=0;i<num;i++){ + list[list.length-1].children.push(data) + } + } + } + } }, watch:{ formData(newVal){ if(newVal){ - this.projectList = [] - console.log(newVal) + this.prjdata = [] + console.log("formData鍙樺寲--",newVal) this.tableData = newVal this.initData() - // this.initProjectList(this.projectList) + this.initprjdata(this.prjdata) } } }, } </script> -<style scoped> +<style lang="scss"> table{ mso-displayed-decimal-separator: "\."; mso-displayed-thousand-separator: "\,"; @@ -1706,4 +1848,110 @@ mso-font-charset: 134; mso-char-type: none; } + +.head{ + display: flex; + .head-1{ + padding: 40px; + } + .head-2{ + margin-left: auto; + margin-right: 0; + margin-top: 13px; + text-align: right; + } +} +.bodycss{ + // margin-left: 85px; +} +.bodycs{ + // margin-left: 135px; + margin-top: -30px; +} +.bodycs-1{ + display: flex; + text-align: left; + height: 60px; + width: auto; + margin-top: -80px; + } +.bodycs-2{ + display: flex; + margin-left: 130px; + margin-top: 30px; +} +.bodycs-3{ + display: flex; + margin-left: 140px; +} +.ziti{ + font-size: 38pt; + font-family: 瀹嬩綋; + margin-left: 80px; +} +.chilen{ + display: flex; + margin-left: 250px; +} +.cldata{ + display: flex; + margin-left: 130px; +} +.pagefooting{ + +} +.x1111111{ + padding: 0px; + mso-ignore: padding; + color: black; + font-size: 50pt; + font-weight: 400; + font-style: normal; + text-decoration: none; + font-family: 瀹嬩綋; + mso-generic-font-family: auto; + mso-font-charset: 134; + mso-number-format: General; + text-align: general; + vertical-align: middle; + mso-background-source: auto; + mso-pattern: auto; + white-space: nowrap; +} +.x1111112{ + padding: 0px; + mso-ignore: padding; + color: black; + font-size: 20pt; + font-weight: 400; + font-style: normal; + text-decoration: none; + font-family: 瀹嬩綋; + mso-generic-font-family: auto; + mso-font-charset: 134; + mso-number-format: General; + text-align: general; + vertical-align: middle; + mso-background-source: auto; + mso-pattern: auto; + white-space: nowrap; +} +.x1111113{ + padding: 0px; + mso-ignore: padding; + color: black; + font-size: 20pt; + font-weight: 400; + font-style: normal; + text-decoration: none; + font-family: 榛戜綋; + mso-generic-font-family: auto; + mso-font-charset: 134; + mso-number-format: General; + text-align: general; + vertical-align: middle; + mso-background-source: auto; + mso-pattern: auto; + white-space: nowrap; +} </style> \ No newline at end of file diff --git a/src/views/quality/finishedProductInspection/index.vue b/src/views/quality/finishedProductInspection/index.vue index def20b0..a1713f8 100644 --- a/src/views/quality/finishedProductInspection/index.vue +++ b/src/views/quality/finishedProductInspection/index.vue @@ -21,7 +21,7 @@ <printTemplate id="printRaw" :formData="printFormData"></printTemplate> </div> <span slot="footer" class="dialog-footer"> - <el-button @click="()=>{printDialogVisible = false;this.printFormData=null}">鍙� 娑�</el-button> + <el-button @click="()=>{printDialogVisible = false;printFormData=null}">鍙� 娑�</el-button> <el-button type="primary" @click="printFun()">鎵� 鍗�</el-button> </span> </el-dialog> @@ -205,21 +205,26 @@ watch:{ printFormData(newVal){ if(newVal){ + console.log("pData鍙樺寲--",newVal); this.printFormData = newVal } } }, methods: { - + closedown(){ + // this.printFormData = [] + this.printDialogVisible = false; + }, //鎵撳嵃鎸夐挳 printFun() { this.printDialogVisible = false; PrintJS({ printable: "printRaw", type: "html", - maxWidth: 700, - style: '@page {margin: 0 5mm}', + maxWidth: 950, + style: '@page {margin: 2.0mm 2.0mm}', targetStyles: ["*"], + // importCSS: true, ignoreElements: ["no-ignore"], orientation: 'portrait' }); diff --git a/vue.config.js b/vue.config.js index 204c9ea..95ba268 100644 --- a/vue.config.js +++ b/vue.config.js @@ -2,9 +2,9 @@ * 閰嶇疆鍙傝��: * https://cli.vuejs.org/zh/config/ */ -// const url = 'http://192.168.0.23:9999' +const url = 'http://192.168.0.23:9999' - const url = 'http://192.168.0.60:9999' + // const url = 'http://192.168.0.60:9999' // const url = 'http://ztt-gateway:9999' const localUrl = 'http://localhost:8089' -- Gitblit v1.9.3