维修记录表修正

This commit is contained in:
hongchao 2025-10-23 17:51:25 +08:00
parent 14b248fd21
commit c791c8ae15
2 changed files with 37 additions and 19 deletions

View File

@ -119,11 +119,11 @@
</div>
</div>
<div style="border: 3px solid #000; min-height: 900px; line-height: 3; position: relative">
<div style="border: 3px solid #000; min-height: 690px; line-height: 3; position: relative">
<div style="font-weight: 800; border-bottom: 1px solid #888; display: flex">
<div style="width: 100%; padding-left: 10px;text-align: center">{{this.printInfo.typeName }}</div>
</div>
<div v-for="(group, groupIndex) in groupPrintData" :key="groupIndex" style="display: flex; border-bottom: 1px solid #000;">
<div v-for="(group, groupIndex) in groupPrintData" :key="groupIndex" style="display: flex; border-bottom: 1px solid #000">
<!-- 遍历分组中的每个元素每个元素生成 name status 两个表格 -->
<div v-for="(row, index) in group" :key="index" style="flex: 1; display: flex; border-right: 1px solid #000;">
<div style="flex: 1; text-align: center; border-right: 1px solid #000; padding: 3px;">
@ -136,23 +136,23 @@
</div>
<div style="position: absolute; bottom: 0; width: 100%;">
<div style="font-weight: 800; border-bottom: 1px solid #888;border-top: 1px solid #888; display: flex">
<div style="width: 20%; text-align: center;border-right: 1px solid #888;">其他</div>
<div style="width: 80%; text-align: center; display: flex; justify-content: space-between; ">
<span style="margin-left: 25px;">{{otherData}}</span>
</div>
</div>
<div style="font-weight: 800; border-bottom: 1px solid #888; display: flex">
<div style="width: 20%; text-align: center;border-right: 1px solid #888;">空载试验</div>
<div style="width: 80%; text-align: center; display: flex; justify-content: space-between; ">
<!-- <span style="margin-left: 10px;">维修提交合格<span style="letter-spacing: 2em;"> </span></span>
<span>维修提交报废<span style="letter-spacing: 2em;"> </span></span> -->
<span style="margin-left: 10px;">维修提交合格<span :style="{ letterSpacing: printInfo && printInfo.scrapNum === 0 ? '0.9em' : '2em' }">
<!-- scrapNum 等于 0 时显示打勾图片 -->
<img v-if="printInfo && printInfo.scrapNum === 0" src="../../../../assets/img/yes.png" alt="√" style="vertical-align: middle; height: 1em; margin: 0 1.0em 0 0; display: inline-block;"/>
</span></span>
<span>维修提交报废<span :style="{ letterSpacing: printInfo && printInfo.scrapNum > 0 ? '1.0em' : '2em' }">
<!-- scrapNum 大于 0 时显示打勾图片 -->
<img v-if="printInfo && printInfo.scrapNum > 0" src="../../../../assets/img/yes.png" alt="" style="vertical-align: middle; height: 1em; margin: 0 1.0em 0 0; display: inline-block;"/>
<span style="margin-left: 25px;">合格<span style="letter-spacing: 1.5em;"><img v-if="printInfo && printInfo.scrapNum === 0" src="../../../../assets/img/yes.png" alt="√" style="vertical-align: middle; height: 1em; margin: 0 1.2em 0 0; display: inline-block;"/></span></span>
<span style="margin-right: 200px;">不合格<span :style="{ letterSpacing: printInfo && printInfo.scrapNum > 0 ? '1.0em' : '2em' }">
<img v-if="printInfo && printInfo.scrapNum > 0" src="../../../../assets/img/yes.png" alt="" style="vertical-align: middle; height: 1em; margin: 0 1.2em 0 0; display: inline-block;"/>
</span></span>
</div>
</div>
<div style="font-weight: 800; border-bottom: 1px solid #888; display: flex">
<div style="width: 20%; text-align: center;border-right: 1px solid #888;">标识</div>
<div style="width: 20%; text-align: center;border-right: 1px solid #888;">标识是否齐全</div>
<div style="width: 80%; text-align: center; display: flex; justify-content: space-between;">
<span style="margin-left: 10px;">二维码<span style="letter-spacing: 1.5em;"><img src="../../../../assets/img/yes.png" alt="√" style="vertical-align: middle; height: 1em; margin: 0 1.2em 0 0; display: inline-block;"/></span></span>
<span>铭牌<span style="letter-spacing: 1.5em;"><img src="../../../../assets/img/yes.png" alt="√" style="vertical-align: middle; height: 1em; margin: 0 1.2em 0 0; display: inline-block;"/></span></span>
@ -165,7 +165,7 @@
<!-- 第一行试验记录标题 -->
<div style="display: flex; border-bottom: 1px solid #888;height: 40px;">
<div style="flex: 1; text-align: center; border-right: 1px solid #888;">额定负载</div>
<div style="flex: 1; text-align: center; border-right: 1px solid #888;">试验负载(T/MPa)</div>
<div style="flex: 1; text-align: center; border-right: 1px solid #888;">试验负载(t/MPa)</div>
<div style="flex: 1; text-align: center;">持荷时间(/)</div>
</div>
<!-- 第二行试验记录结果 -->
@ -184,7 +184,7 @@
<div style="display: flex;height: 40px;">
<div style="flex: 1; text-align: center; border-right: 1px solid #888;">{{ formatDate(printInfo.createTime) }}</div>
<div style="flex: 1; text-align: center; border-right: 1px solid #888;">{{ this.printInfo.repairer }}</div>
<div style="flex: 1; text-align: center;">{{ this.printInfo.userName }}</div>
<div style="flex: 1; text-align: center;">{{ this.printInfo.repairer }}</div>
</div>
</div>
<!-- 右边部分占三分之一 -->
@ -256,6 +256,7 @@ import {
} from '@/api/back/index.js'
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import printJS from 'print-js'
export default {
name: 'TestRecord',
dicts: [],
@ -302,6 +303,8 @@ export default {
},
dialogVisible: false, //
printTableData: [],
printOtherData: [],
otherData: "", //
printInfo:{},
testResult1: '',
testResult2: '',
@ -452,18 +455,20 @@ export default {
async handleRecord(row){
this.dialogVisible = true;
this.printTableData = [];
this.printOtherData = [];
this.otherData = "";
let param = {
id:row.id,
}
const res = await getTestRecordDetails(param)
this.printInfo = res.data[0]
if(this.printInfo && this.printInfo.ratedLoad) {
this.testResult1 = this.printInfo.ratedLoad + '(T/MPa)'
this.testResult1 = this.printInfo.ratedLoad + '(t/MPa)'
} else {
this.testResult1 = ''
}
if(this.printInfo && this.printInfo.testLoad) {
this.testResult2 = this.printInfo.testLoad + '(T/MPa)'
this.testResult2 = this.printInfo.testLoad + '(t/MPa)'
} else {
this.testResult2 = ''
}
@ -474,8 +479,19 @@ export default {
}
if(res.data[0].partTypeList&& res.data[0].partTypeList.length != 0){
res.data[0].partTypeList.forEach((e) => {
this.printTableData.push({'partName':e.partName,'status':'不合格更换'})
if(e.isSure == 1 && e.isShow == 1){
this.printTableData.push({'partName':e.partName,'status':'更换'})
}else if(e.isSure == 1 && e.isShow == 0){
this.printTableData.push({'partName':e.partName,'status':'合格'})
}else if(e.isSure == 0 && e.isShow == 0){
this.printOtherData.push({'partName':e.partName,'status':''})
this.otherData = this.otherData + e.partName + '、'
}
})
//
if(this.otherData.length > 0){
this.otherData = this.otherData.substring(0, this.otherData.length - 1)
}
}
},
@ -499,6 +515,8 @@ export default {
this.dialogVisible = false; //
this.printInfo = {}; //
this.printTableData = []; //
this.printOtherData = []; //
this.otherData = ""; //
this.testResult1 = '';
this.testResult2 = '';
this.testResult3 = '';

View File

@ -204,10 +204,10 @@
<div class="tip-text">投入费用万元</div>
</div>
<div class="tip-box">
<!-- <div class="tip-box">
<div class="tip-num">¥ {{ tipForm.rentPrice || 0 }}</div>
<div class="tip-text">租赁费用万元</div>
</div>
</div> -->
<!-- <div class="tip-box">
<div class="tip-num">{{ tipForm.countNum || 0 }}</div>