| | |
| | | <template> |
| | | <div style="word-wrap:break-word;text-justify-trim:punctuation"> |
| | | <div> |
| | | <div style="margin-top:20pt;word-wrap:break-word;text-justify-trim:punctuation" :key="i" v-for="(project,i) in projectList"> |
| | | <div class="WordSection1" style="layout-grid:15.6pt;"> |
| | | <div align="center"> |
| | | <table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" width="629" |
| | |
| | | <span style="font-size:10.0pt;font-family:宋体">检验记录表</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">-</span> |
| | | <span style="font-size:10.0pt;font-family:宋体">机加工件</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"> </span><span style="font-size:10.0pt;font-family:宋体">(</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif">Inpection Record-machining </span> |
| | | <span style="font-size:10.0pt;font-family:宋体">)</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"> </span> |
| | | <span style="font-size:10.0pt;font-family:宋体">页码(</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"> Page No.</span><span style="font-size:10.0pt;font-family:宋体">):</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"> </span> |
| | | <span style="font-size:10.0pt;font-family:宋体">页码(</span> |
| | | <span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"> Page No.</span> |
| | | <span style="font-size:10.0pt;font-family:宋体">):</span> |
| | | <span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif"> |
| | | {{i+1}} |
| | | </span> |
| | | </p> |
| | | <div align="center"> |
| | | <table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" width="628" |
| | |
| | | </td> |
| | | <td width="127" colspan="5" style="width:95.5pt;border:solid windowtext 1.0pt;border-left:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"> |
| | | <span lang="EN-US" style="font-family:"Arial",sans-serif" v-text="tableData.name"></span> |
| | | <span lang="EN-US" style="font-family:"Arial",sans-serif" v-text="project.name"></span> |
| | | </p> |
| | | </td> |
| | | <td width="113" colspan="3" style="width:84.95pt;border:solid windowtext 1.0pt;border-left:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt"> |
| | |
| | | </td> |
| | | <td width="86" colspan="4" style="width:64.65pt;border:solid windowtext 1.0pt;border-left:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif" v-text="tableData.specs"></span></p> |
| | | style="font-family:"Arial",sans-serif" v-text="project.specs"></span></p> |
| | | </td> |
| | | <td width="72" colspan="2" style="width:54.35pt;border:solid windowtext 1.0pt;border-left:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span |
| | |
| | | </td> |
| | | <td width="128" colspan="3" style="width:96.0pt;border:solid windowtext 1.0pt;border-left:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif" v-text="tableData.rmessage.split(',')[0]"></span></p> |
| | | style="font-family:"Arial",sans-serif" v-text="project.rmessage.split(',')[0]"></span></p> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | |
| | | </td> |
| | | <td width="86" colspan="4" style="width:64.65pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif" v-text="tableData.number"></span></p> |
| | | style="font-family:"Arial",sans-serif" v-text="project.number"></span></p> |
| | | </td> |
| | | <td width="72" colspan="2" style="width:54.35pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span |
| | |
| | | </td> |
| | | <td width="128" colspan="3" style="width:96.0pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif" v-text="tableData.supplier"></span></p> |
| | | style="font-family:"Arial",sans-serif" v-text="project.supplier"></span></p> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | |
| | | </td> |
| | | <td width="43" v-for="(item,index) in columnLength" :key="index" colspan="1" style="width:32.2pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-size:9.0pt;font-family:"Arial",sans-serif">{{item>9?item:'0'+item}}</span></p> |
| | | style="font-size:9.0pt;font-family:"Arial",sans-serif">{{item>9||i>0?(item+(i*columnLength)):'0'+item}}</span></p> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | <tbody v-for="(item,index) in projectList" :key="index"> |
| | | <tbody v-for="(item,index) in project.children" :key="index"> |
| | | <tr style="height:19.85pt"> |
| | | <td width="85" :rowspan="item.children.length" style="width:63.95pt;border:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span |
| | |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif" v-text="item.children[0].required"></span></p> |
| | | </td> |
| | | <td width="43" v-for="(val,index) in item.children[0].testValueList" :key="index" colspan="1" style="width:32.2pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <td width="43" v-for="(val,index) in item.children[0].testValList" :key="index" colspan="1" style="width:32.2pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif">{{val}}</span></p> |
| | | </td> |
| | |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif">{{j.required}}</span></p> |
| | | </td> |
| | | <td width="59" v-for="(testValue,index) in j.testValueList" :key="index" style="width:44.4pt;border:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <td width="59" v-for="(testValue,index) in j.testValList" :key="index" style="width:44.4pt;border:1pt solid windowtext;padding:0.2cm 5.4pt 0.2cm 5.4pt;height:19.85pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif">{{testValue}}</span></p> |
| | | </td> |
| | |
| | | <p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" |
| | | style="font-family:"Arial",sans-serif" v-text="tableData.creatTime.split(' ')[0]"></span></p> |
| | | </td> |
| | | <td width="83" colspan="3" style="width:62.25pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:none;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt"> |
| | | <td width="83" dis colspan="3" style="width:62.25pt;border-top:1pt solid windowtext;border-left:1pt solid windowtext;border-bottom:none;border-right:solid windowtext 1.0pt;padding:0.2cm 5.4pt 0.2cm 5.4pt"> |
| | | <p class="MsoNormal" align="center" style="text-align:center"> |
| | | <span style="font-family:宋体">审</span> |
| | | <span lang="EN-US" style="font-family:"Arial",sans-serif"> </span> |
| | |
| | | <p class="MsoNormal"><span lang="EN-US"> </span></p> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | type: Object, |
| | | default:()=>{ |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | | created(){ |
| | | this.tableData = this.formData |
| | | this.initData() |
| | | }, |
| | | watch:{ |
| | | formData(newVal){ |
| | | if(newVal){ |
| | | this.projectList = [] |
| | | this.tableData = newVal |
| | | this.initData() |
| | | } |
| | | } |
| | | }, |
| | |
| | | methods:{ |
| | | initData(){ |
| | | let deviceNameList = [] |
| | | let maxLen = 0 |
| | | let pageSize = 0 |
| | | if(this.tableData.children){ |
| | | this.tableData.children.forEach(e => { |
| | | this.projectList.push(e) |
| | | if(e.children){ |
| | | e.children.forEach(o =>{ |
| | | if(o.testValue){ |
| | | let testValList = o.testValue.split(",") |
| | | if( testValList.length > maxLen){ |
| | | maxLen = testValList.length |
| | | } |
| | | } |
| | | if(o.deviceName){ |
| | | deviceNameList.push(o.deviceName) |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | }) |
| | | pageSize = Math.ceil(Number(maxLen)/Number(this.columnLength)) |
| | | this.tableData.children.forEach(ele=>{ |
| | | if(ele.children){ |
| | | ele.children.forEach(obj =>{ |
| | | let testValList = [] |
| | | if(obj.testValue){ |
| | | testValList = obj.testValue.split(",") |
| | | } |
| | | let size = (this.columnLength*pageSize) - (testValList.length) |
| | | obj.testValList = testValList |
| | | for(var i=0;i<size;i++){ |
| | | obj.testValList.push('') |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | this.pageDataFun(pageSize,this.tableData) |
| | | this.deviceStr = Array.from(new Set(deviceNameList)).join(",") |
| | | }, |
| | | initProjectList(list){ |
| | | //获取每页的检验项目 |
| | | pageDataFun(pageSize,data){ |
| | | let tabData = [] |
| | | if(pageSize>0 && data){ |
| | | for(var i=0;i<pageSize;i++){ |
| | | let obj = JSON.parse(JSON.stringify(data)) |
| | | if(obj.children){ |
| | | obj.children.forEach(o=>{ |
| | | if(o.children){ |
| | | o.children.forEach(e=>{ |
| | | if(e.testValList){ |
| | | let colLen = this.columnLength |
| | | let start = colLen*i |
| | | let end = ((1+i)*colLen) |
| | | e.testValList = e.testValList.slice(start,end) |
| | | tabData.push(obj) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | this.initRow(obj.children) |
| | | } |
| | | } |
| | | } |
| | | this.projectList = tabData |
| | | }, |
| | | initRow(list){ |
| | | const data = { |
| | | deviceId: '', |
| | | deviceName: '', |
| | |
| | | rpUnit: '', |
| | | testState: null, |
| | | userName: '', |
| | | testValueList: new Array(this.columnLength) |
| | | testValList: new Array(this.columnLength) |
| | | } |
| | | let rowNum = 15 |
| | | let columnNum = this.columnLength |
| | | if(list && list.length<2){ |
| | | list.forEach(item=>{ |
| | | if(item.children && item.children.length < rowNum){ |
| | | rowNum-=item.children.length |
| | | for(let j=0;j<item.children.length;j++){ |
| | | let arr = [] |
| | | if(item.children[j].testValue){ |
| | | arr = item.children[j].testValue.split(",") |
| | | } |
| | | item.children[j].testValueList = arr |
| | | if(item.children[0].testValueList.length< columnNum ){ |
| | | let num = columnNum - item.children[j].testValueList.length |
| | | for(let i=0;i<num;i++){ |
| | | item.children[j].testValueList.push("") |
| | | } |
| | | } |
| | | } |
| | | for(let i=0;i< rowNum;i++){ |
| | | item.children.push(data) |
| | | } |
| | |
| | | list.forEach(item=>{ |
| | | if(item.children){ |
| | | size+=item.children.length |
| | | item.children.forEach(obj=>{ |
| | | if(obj.testValue){ |
| | | let testValueList = obj.testValue.split(",") |
| | | obj.testValueList = testValueList |
| | | if(testValueList.length < columnNum){ |
| | | let len = columnNum-testValueList.length |
| | | for(var i=0;i<len;i++){ |
| | | obj.testValueList.push("") |
| | | } |
| | | } |
| | | }else{ |
| | | obj.testValueList = new Array(12) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | if(size < rowNum){ |
| | |
| | | } |
| | | } |
| | | } |
| | | this.projectList = list |
| | | } |
| | | }, |
| | | created(){ |
| | | this.tableData = this.formData |
| | | this.initData() |
| | | this.initProjectList(this.projectList) |
| | | }, |
| | | watch:{ |
| | | formData(newVal){ |
| | | if(newVal){ |
| | | this.projectList = [] |
| | | this.tableData = newVal |
| | | this.initData() |
| | | this.initProjectList(this.projectList) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |