维修记录表
This commit is contained in:
		
							parent
							
								
									85c85acd24
								
							
						
					
					
						commit
						a1ee473205
					
				| 
						 | 
				
			
			@ -104,7 +104,7 @@ export function getRepairCodeList(query) {
 | 
			
		|||
 | 
			
		||||
export function getRepairRecord(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/material/repair/getRepairRecord',
 | 
			
		||||
    url: '/material/repair/getTestRecordData',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 3.2 KiB  | 
| 
						 | 
				
			
			@ -109,7 +109,7 @@
 | 
			
		|||
 | 
			
		||||
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100" fixed="right">
 | 
			
		||||
              <template slot-scope="scope">
 | 
			
		||||
                  <el-button size="mini" type="primary"   @click="handleRepair(scope.row)">维修记录</el-button>
 | 
			
		||||
                  <el-button size="mini" type="primary" v-if="scope.row.manageType == 0"   @click="handleRepair(scope.row)">维修记录</el-button>
 | 
			
		||||
              </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
| 
						 | 
				
			
			@ -140,27 +140,27 @@
 | 
			
		|||
                  <div
 | 
			
		||||
                        class="item"
 | 
			
		||||
                        style="flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
 | 
			
		||||
                        <span>退料单号:{{}}</span>
 | 
			
		||||
                        <span>退料单号:{{this.printInfo.code}}</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div
 | 
			
		||||
                        class="item"
 | 
			
		||||
                        style="flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
 | 
			
		||||
                        <span>提交日期:{{}}</span>
 | 
			
		||||
                        <span>提交日期:{{this.printInfo.createTime}}</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="item" style="flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
 | 
			
		||||
                        <span>设备编号:{{}}</span>
 | 
			
		||||
                        <span>设备编号:{{this.printInfo.maCode}}</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
          <div style="border: 3px solid #000; min-height: 900px; 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">{{'手动角磨机' }}</div>
 | 
			
		||||
              <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;">
 | 
			
		||||
              <!-- 遍历分组中的每个元素,每个元素生成 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;">
 | 
			
		||||
                  <span style="display: block;">{{ row.name || '' }}</span>
 | 
			
		||||
                  <span style="display: block;">{{ row.partName || '' }}</span>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div style="flex: 1; text-align: center; padding: 3px;">
 | 
			
		||||
                  <span style="display: block;">{{ row.status || '' }}</span>
 | 
			
		||||
| 
						 | 
				
			
			@ -171,8 +171,16 @@
 | 
			
		|||
            <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: 10px;">维修提交合格<span style="letter-spacing: 2em;">(    )</span></span>
 | 
			
		||||
                <span>维修提交报废<span style="letter-spacing: 2em;">(    )</span></span>
 | 
			
		||||
                <!-- <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></span>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -180,8 +188,8 @@
 | 
			
		|||
              <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 style="font-weight: bold;">√</span>)</span></span>
 | 
			
		||||
                 <span>档位<span style="letter-spacing: 2em;">(    )</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>
 | 
			
		||||
                <span>档位<span style="letter-spacing: 2em;">(    )</span></span>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -189,7 +197,7 @@
 | 
			
		|||
              <div style="width: 60%;  display: flex; flex-direction: column;">
 | 
			
		||||
                <!-- 第一行:试验记录标题 -->
 | 
			
		||||
                <div style="display: flex; border-bottom: 1px solid #888;height: 40px;">
 | 
			
		||||
                  <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;">额定负载</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>
 | 
			
		||||
| 
						 | 
				
			
			@ -207,9 +215,9 @@
 | 
			
		|||
                </div>
 | 
			
		||||
                <!-- 第四行:对应结果 -->
 | 
			
		||||
                <div style="display: flex;height: 40px;">
 | 
			
		||||
                  <div style="flex: 1; text-align: center; border-right: 1px solid #888;">{{ '2025-06-14' }}</div>
 | 
			
		||||
                  <div style="flex: 1; text-align: center; border-right: 1px solid #888;">{{ '张三' }}</div>
 | 
			
		||||
                  <div style="flex: 1; text-align: center;">{{  '李四' }}</div>
 | 
			
		||||
                  <div style="flex: 1; text-align: center; border-right: 1px solid #888;">{{ this.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>
 | 
			
		||||
              </div>
 | 
			
		||||
              <!-- 右边部分,占三分之一 -->
 | 
			
		||||
| 
						 | 
				
			
			@ -334,7 +342,8 @@ export default {
 | 
			
		|||
            dialogList: [],
 | 
			
		||||
            openRepair: false,
 | 
			
		||||
            repairRecord: [],
 | 
			
		||||
            printTableData: [{'name':'角磨1','status':'合格'},{'name':'角磨2','status':'合格'},{'name':'角磨3','status':'合格'},{'name':'角磨4','status':'合格'},{'name':'角磨5','status':'合格'}], 
 | 
			
		||||
            printTableData: [], 
 | 
			
		||||
            printInfo:{},
 | 
			
		||||
            testResult1: '',
 | 
			
		||||
            testResult2: '',
 | 
			
		||||
            testResult3: '',
 | 
			
		||||
| 
						 | 
				
			
			@ -347,11 +356,12 @@ export default {
 | 
			
		|||
    computed: {
 | 
			
		||||
        groupPrintData() {
 | 
			
		||||
            const result = [];
 | 
			
		||||
            console.log("xxxxxxxxxxxxx",this.printTableData.length)
 | 
			
		||||
            for (let i = 0; i < this.printTableData.length; i += 2) {
 | 
			
		||||
                const group = this.printTableData.slice(i, i + 2);
 | 
			
		||||
                // 若分组不足 2 个元素,补充空对象
 | 
			
		||||
                while (group.length < 2) {
 | 
			
		||||
                    group.push({ name: '', status: '' });
 | 
			
		||||
                    group.push({ partName: '', status: '' });
 | 
			
		||||
                }
 | 
			
		||||
                result.push(group);
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			@ -393,10 +403,31 @@ export default {
 | 
			
		|||
 | 
			
		||||
    async handleRecord(row){
 | 
			
		||||
      this.dialogVisible = true;
 | 
			
		||||
      // let param  = {
 | 
			
		||||
      //   taskId:this.repairRow.taskId,
 | 
			
		||||
      // }
 | 
			
		||||
      // const res = await getRepairRecord(param)
 | 
			
		||||
      let param  = {
 | 
			
		||||
        id:row.id,
 | 
			
		||||
      }
 | 
			
		||||
      const res = await getRepairRecord(param)
 | 
			
		||||
      this.printInfo = res.data[0]
 | 
			
		||||
      if(this.printInfo && this.printInfo.ratedLoad) {
 | 
			
		||||
          this.testResult1 = this.printInfo.ratedLoad + '(T/MPa)'
 | 
			
		||||
      } else {
 | 
			
		||||
          this.testResult1 = ''
 | 
			
		||||
      }
 | 
			
		||||
      if(this.printInfo && this.printInfo.testLoad) {
 | 
			
		||||
          this.testResult2 = this.printInfo.testLoad + '(T/MPa)'
 | 
			
		||||
      } else {
 | 
			
		||||
          this.testResult2 = ''
 | 
			
		||||
      }
 | 
			
		||||
      if(this.printInfo && this.printInfo.holdingTime) {
 | 
			
		||||
          this.testResult3 = this.printInfo.holdingTime + '(分/秒)'
 | 
			
		||||
      } else {
 | 
			
		||||
          this.testResult3 = ''
 | 
			
		||||
      }
 | 
			
		||||
      if(res.data[0].partTypeList&& res.data[0].partTypeList.length != 0){
 | 
			
		||||
        res.data[0].partTypeList.forEach((e) => {
 | 
			
		||||
          this.printTableData.push({'partName':e.partName,'status':'合格'})
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    // 打印
 | 
			
		||||
| 
						 | 
				
			
			@ -417,3 +448,4 @@ export default {
 | 
			
		|||
    },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue