Merge branch 'material-ui' of http://192.168.0.75:3000/bonus/bonus-ui into material-ui

This commit is contained in:
BianLzhaoMin 2025-06-15 14:35:26 +08:00
commit 64ec72e9f4
5 changed files with 307 additions and 12 deletions

View File

@ -91,4 +91,21 @@ export function getRepairDocumentInfo(taskId) {
url: '/material/repair/getRepairDocumentInfo/?taskId=' + taskId,
method: 'get',
})
}
//获取维修记录
export function getRepairCodeList(query) {
return request({
url: '/material/repair/getRepairCodeList',
method: 'get',
params: query
})
}
export function getRepairRecord(query) {
return request({
url: '/material/repair/getTestRecordData',
method: 'get',
params: query
})
}

BIN
src/assets/img/yes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -39,6 +39,7 @@
/>
</el-select>
</el-form-item>
<el-form-item prop="materialModel">
<el-select v-model="queryParams.materialModel" placeholder="请选择规格型号" clearable filterable >
@ -51,6 +52,16 @@
</el-select>
</el-form-item>
<el-form-item prop="maStatus">
<el-select v-model="queryParams.maStatus" placeholder="请选择设备状态" clearable filterable >
<el-option
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in dict.type.ma_machine_status"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -383,6 +394,7 @@
import html2canvas from 'html2canvas';
export default {
name: "Device",
dicts: ["ma_machine_status"],
data() {
return {
//
@ -431,7 +443,8 @@
pageNum: 1,
pageSize: 10,
keyWord:undefined,
isAssets:undefined
isAssets:undefined,
maStatus:null,
},
//
queryTeam: {
@ -735,6 +748,7 @@
resetQuery() {
this.resetForm("queryForm");
this.queryParams.keyWord=null;
this.queryParams.maStatus=null;
this.handleQuery();
},

View File

@ -249,6 +249,7 @@
import { getListNewBuy,getInBoundForm } from '@/api/part/partArrived';
import { passAll, rejectAll } from '@/api/part/partAccept';
import vueEasyPrint from "vue-easy-print";
import printJS from 'print-js'
import { downloadFile } from '@/utils/download'
import { getToken } from '@/utils/auth'
export default {
@ -419,16 +420,16 @@ import { getToken } from '@/utils/auth'
});
},
//
// print() {
// // this.$refs.remarksPrintRef.print()
// printJS({
// printable: 'checkId',
// type: 'html',
// targetStyles: ['*'],
// maxWidth:'1400'
// //
// });
// },
print() {
// this.$refs.remarksPrintRef.print()
printJS({
printable: 'checkId',
type: 'html',
targetStyles: ['*'],
maxWidth:'1400'
//
});
},
handleExport() {
const formatTime = (date) => {
const year = date.getFullYear();

View File

@ -106,20 +106,191 @@
<div v-if="scope.row.manageType == 1">数量管理</div>
</template>
</el-table-column>
<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" v-if="scope.row.manageType == 0" @click="handleRepair(scope.row)">维修记录</el-button>
</template>
</el-table-column>
</el-table>
<!-- 维修记录弹窗 -->
<el-dialog title="维修记录" :visible.sync="openRepair" width="46%">
<el-table :data="repairRecord" border>
<el-table-column label="类型名称" prop="typeName" align="center"></el-table-column>
<el-table-column label="规格型号" prop="type" align="center"></el-table-column>
<el-table-column label="机具编号" prop="code" align="center"></el-table-column>
<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="handleRecord(scope.row)">试验记录表</el-button>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="openRepair = false">关闭</el-button>
</span>
</el-dialog>
<!-- 弹框 -->
<el-dialog title="试验记录表" :visible.sync="dialogVisible" width="46%">
<div id="print-content">
<vue-easy-print tableShow ref="remarksPrintRef2" class="print" style="margin: 0 20px">
<div style="text-align: center; font-weight: 600; font-size: 30px">机具物流分公司动力设备维修及试验记录单</div>
<div class="info" style="margin: 10px 20px 0; display: flex; justify-content: space-between;">
<div
class="item"
style="flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>退料单号{{this.printInfo.code}}</span>
</div>
<div
class="item"
style="flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<span>提交日期{{this.printInfo.createTime}}</span>
</div>
<div class="item" style="flex-shrink: 0;margin-bottom: 5px;font-size: 14px;">
<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">{{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.partName || '' }}</span>
</div>
<div style="flex: 1; text-align: center; padding: 3px;">
<span style="display: block;">{{ row.status || '' }}</span>
</div>
</div>
</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: 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>
<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: 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>
<div style="font-weight: 800; border-bottom: 1px solid #888; display: flex">
<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;">额定负载</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>
<!-- 第二行试验记录结果 -->
<div style="display: flex; border-bottom: 1px solid #888;height: 40px;">
<div style="flex: 1; text-align: center; border-right: 1px solid #888;">{{ testResult1 || '' }}</div>
<div style="flex: 1; text-align: center; border-right: 1px solid #888;">{{ testResult2 || '' }}</div>
<div style="flex: 1; text-align: center;">{{ testResult3 || '' }}</div>
</div>
<!-- 第三行试验日期检验人员提交人员标题 -->
<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;">检修人员</div>
<div style="flex: 1; text-align: center;">试验人员</div>
</div>
<!-- 第四行对应结果 -->
<div style="display: flex;height: 40px;">
<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>
<!-- 右边部分占三分之一 -->
<div style="width: 40%; display: flex; border-left: 1px solid #888;">
<!-- 第一列试验结论 -->
<div style="width: 25%;text-align: center; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid #888;">
<span>试验结论</span>
</div>
<!-- 第二列合格 -->
<div style="width: 75%; padding: 0;">
<input
type="text"
v-model="testConclusion"
style="
width: 100%;
height: 100%;
font-size: 64px;
color: red;
font-weight: bold;
border: none;
outline: none;
box-sizing: border-box;
text-align: center;
background-color: white;
font-family: SimSun;
"
/>
</div>
</div>
</div>
</div>
</div>
<div class="fillIn" style="margin-top: 10px; display: flex; justify-content: space-between">
<div class="item" style="width: 33%">
<div>
<span>审核{{ }}</span>
</div>
</div>
<div class="item" style="width: 33%">
<div>
<span>检验员{{ '高民' }}</span>
</div>
</div>
</div>
</vue-easy-print>
</div>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="print"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getAppRepairMaTypeList,
getAppRepairMaTypeList,getRepairCodeList,getRepairRecord
} from "@/api/repair/repair.js";
import { mapState } from 'vuex'
import { getToken } from "@/utils/auth";
import vueEasyPrint from "vue-easy-print";
import printJS from 'print-js';
export default {
name: 'ReturnApplyAdd',
dicts: ["ma_machine_status"],
components: { vueEasyPrint },
props: {
repairRow: {
type: [Object],
@ -155,12 +326,47 @@ export default {
companyId: '',
createBy: '',
rowId: '',
dialogVisible: false, //
dialogForm: {
proName: '', //
code: '' //
},
dialogColumns: [
{ label: '名称', prop: 'maTypeName', width: '150px' },
{ label: '规格', prop: 'typeName', width: '150px' },
{ label: '单位', prop: 'unitName', width: '60px' },
{ label: '数量', prop: 'preNum', width: '60px' },
{ label: '备注', prop: 'remark', width: '' }
],
dialogList: [],
openRepair: false,
repairRecord: [],
printTableData: [],
printInfo:{},
testResult1: '',
testResult2: '',
testResult3: '',
testConclusion: '合格',
}
},
mounted() {
this.GetViewByApply();
},
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({ partName: '', status: '' });
}
result.push(group);
}
return result;
},
...mapState(["user"]),
},
methods: {
@ -183,6 +389,63 @@ export default {
e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum) - Number(e.typeScrapNum);
});
},
async handleRepair(row){
this.openRepair = true;
console.log("222222",row)
let param = {
taskId: this.repairRow.taskId,
typeId: row.typeId
}
const res = await getRepairCodeList(param)
this.repairRecord = res.data
},
async handleRecord(row){
this.dialogVisible = true;
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':'合格'})
})
}
},
//
print() {
printJS({
printable: 'print-content',
type: 'html', //
// targetStyles: ['*'], //
scanStyles: false, //
// css: [
// 'https://unpkg.com/element-ui/lib/theme-chalk/index.css' // Element UI
// ],
maxWidth: '1400'
//
})
},
},
}
</script>