业务联单取值有误,项目部材料站站长暂时要,项目部技术员是业务联系单创建人

This commit is contained in:
BianLzhaoMin 2025-07-04 13:36:19 +08:00
parent 3c7c64462e
commit 12a65812af
1 changed files with 88 additions and 82 deletions

View File

@ -24,12 +24,12 @@
</el-form-item>
<el-form-item label="审核状态" prop="taskStatus">
<el-select v-model="queryParams.taskStatus" placeholder="请选择审核状态" clearable>
<el-option
v-for="dict in dict.type.lease_apply_task_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
<el-option
v-for="dict in dict.type.lease_apply_task_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
@ -70,7 +70,7 @@
>
<!-- 插槽 -->
<template v-slot="scope" v-if="column.prop == 'taskStatus'">
<dict-tag :options="dict.type.lease_apply_task_status" :value="scope.row.taskStatus"/>
<dict-tag :options="dict.type.lease_apply_task_status" :value="scope.row.taskStatus" />
</template>
</el-table-column>
<!-- 操作 -->
@ -167,7 +167,8 @@
<div>说明</div>
<div>{{ '第一项目管理部(合肥肥东)' }}</div>
<div>项目部材料站站长联系人{{ '徐青松' }} {{ '15234213324' }}</div>
<div>项目部技术联系人{{ '杨金勇' }} {{ '17832421245' }}</div>
<!-- <div>项目部技术联系人{{ '杨金勇' }} {{ '17832421245' }}</div> -->
<div>项目部技术联系人{{ dialogForm.createBy }} {{ dialogForm.phone }}</div>
<div>领取人员{{ dialogForm.leaseUnit }} {{ dialogForm.leasePerson }}{{ dialogForm.phone }}</div>
</div>
@ -263,9 +264,9 @@
<script>
import printJS from 'print-js'
import { getLeaseTaskList, deleteLeaseTask, getLeaseTask, getCodePDF } from '@/api/business/index'
import html2canvas from 'html2canvas';
import jsPDF from 'jspdf';
import request from "@/utils/request";
import html2canvas from 'html2canvas'
import jsPDF from 'jspdf'
import request from '@/utils/request'
export default {
name: 'Index',
@ -286,7 +287,7 @@ export default {
{ label: '待审核', value: '0' },
{ label: '审核中', value: '6' },
{ label: '已完成', value: '2' },
{ label: '已驳回', value: '3' },
{ label: '已驳回', value: '3' }
],
total: 0, //
//
@ -403,34 +404,34 @@ export default {
}
},*/
handleExport() {
const formatTime = (date) => {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
};
const formatTime = date => {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}${month}${day}_${hours}${minutes}${seconds}`
}
const currentTime = formatTime(new Date());
const currentTime = formatTime(new Date())
this.download(
"/material/leaseTask/exportLeaseRecord",
'/material/leaseTask/exportLeaseRecord',
{ ...this.queryParams },
`领用记录数据_${currentTime}.xlsx`
);
)
},
//
print() {
const element = document.getElementById('print-content');
const element = document.getElementById('print-content')
//
if (!element) {
this.$message.error('未找到要打印的元素');
return;
this.$message.error('未找到要打印的元素')
return
}
this.$modal.loading('正在生成单据,请稍候...');
this.$modal.loading('正在生成单据,请稍候...')
// 使html2canvasDOMcanvas
html2canvas(element, {
@ -438,70 +439,75 @@ export default {
useCORS: true, //
allowTaint: true,
backgroundColor: '#ffffff'
}).then(canvas => {
// PDF
const pdf = new jsPDF('p', 'mm', 'a4');
})
.then(canvas => {
// PDF
const pdf = new jsPDF('p', 'mm', 'a4')
// canvas
const imgWidth = 210; // A4(mm)
const pageHeight = 297; // A4(mm)
const imgHeight = canvas.height * imgWidth / canvas.width;
// canvas
const imgWidth = 210 // A4(mm)
const pageHeight = 297 // A4(mm)
const imgHeight = (canvas.height * imgWidth) / canvas.width
// canvas
const imgData = canvas.toDataURL('image/jpeg', 1.0);
// canvas
const imgData = canvas.toDataURL('image/jpeg', 1.0)
// PDF
pdf.addImage(imgData, 'JPEG', 0, 0, imgWidth, imgHeight);
// PDF
pdf.addImage(imgData, 'JPEG', 0, 0, imgWidth, imgHeight)
// PDF
const fileName = `业务联系单_${this.dialogForm.code || '未命名'}_${new Date().getTime()}.pdf`;
// PDF
const fileName = `业务联系单_${this.dialogForm.code || '未命名'}_${new Date().getTime()}.pdf`
// PDFBlob
const pdfBlob = pdf.output('blob');
// PDFBlob
const pdfBlob = pdf.output('blob')
// FormData
const formData = new FormData();
formData.append('file', pdfBlob, fileName);
formData.append('id', this.dialogForm.leaseProjectId);
// FormData
const formData = new FormData()
formData.append('file', pdfBlob, fileName)
formData.append('id', this.dialogForm.leaseProjectId)
//
this.$modal.closeLoading();
//
this.$modal.closeLoading()
// API - 使request
request.post('/material/leaseTask/uploadPdf', formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
}).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('单据文件已保存到服务器');
// API - 使request
request
.post('/material/leaseTask/uploadPdf', formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
})
.then(response => {
if (response.code === 200) {
this.$modal.msgSuccess('单据文件已保存到服务器')
//
printJS({
printable: 'print-content',
type: 'html',
scanStyles: false,
maxWidth: '1400'
});
} else {
this.$modal.msgError('保存单据文件失败');
}
}).catch(() => {
this.$modal.msgError('上传单据文件时发生错误');
//
printJS({
printable: 'print-content',
type: 'html',
scanStyles: false,
maxWidth: '1400'
})
} else {
this.$modal.msgError('保存单据文件失败')
}
})
.catch(() => {
this.$modal.msgError('上传单据文件时发生错误')
// 使
printJS({
printable: 'print-content',
type: 'html',
scanStyles: false,
maxWidth: '1400'
});
});
}).catch(error => {
this.$modal.closeLoading();
this.$modal.msgError('生成单据时发生错误');
console.error('生成单据错误:', error);
});
// 使
printJS({
printable: 'print-content',
type: 'html',
scanStyles: false,
maxWidth: '1400'
})
})
})
.catch(error => {
this.$modal.closeLoading()
this.$modal.msgError('生成单据时发生错误')
console.error('生成单据错误:', error)
})
},
//
async getDialogContent(row) {