From 54c4bad8cb09b86f5f0ed0a8412f7862c08832b5 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Mon, 10 Feb 2025 09:19:20 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/costPush/costPush.js | 27 ++ .../material/costPush/pushReview/index.vue | 122 +++++--- .../lease/apply/component/addToolsApply.vue | 278 +++++++++++++++++- .../lease/apply/component/homeApply.vue | 18 +- src/views/material/lease/protocol/index.vue | 23 +- .../repair/repairManage/component/edit.vue | 2 +- 6 files changed, 411 insertions(+), 59 deletions(-) diff --git a/src/api/costPush/costPush.js b/src/api/costPush/costPush.js index 901cd6eb..e3624b59 100644 --- a/src/api/costPush/costPush.js +++ b/src/api/costPush/costPush.js @@ -36,6 +36,33 @@ export function getLeaseList(query) { }) } +// 查询费用推送审核维修列表 +export function getRepairList(query) { + return request({ + url: '/material/iws_cost_push/getRepairCostsByAgreementId', + method: 'get', + params: query + }) +} + +// 查询费用推送审核丢失列表 +export function getLoseList(query) { + return request({ + url: '/material/iws_cost_push/getLoseCostsByAgreementId', + method: 'get', + params: query + }) +} + +// 查询费用推送审核报废列表 +export function getScrapList(query) { + return request({ + url: '/material/iws_cost_push/getScrapCostsByAgreementId', + method: 'get', + params: query + }) +} + // 查询费用结算审核列表 export function getSltExamInfo(query) { diff --git a/src/views/material/costPush/pushReview/index.vue b/src/views/material/costPush/pushReview/index.vue index ea23f1e1..ae367c83 100644 --- a/src/views/material/costPush/pushReview/index.vue +++ b/src/views/material/costPush/pushReview/index.vue @@ -90,10 +90,16 @@ ref="multipleTable" row-key="id" @selection-change="handleSelectionChange" + :span-method="objectSpanMethod" border > - + + + @@ -106,28 +112,40 @@ @@ -145,14 +163,14 @@ 未结算 - + -
+ @@ -408,7 +426,7 @@ import { getUnitList, getAgreementInfoById, } from '@/api/back/index.js' -import {getPushReviewList,getLeaseList } from "@/api/costPush/costPush"; +import {getPushReviewList,getLeaseList,getRepairList,getLoseList,getScrapList } from "@/api/costPush/costPush"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; export default { @@ -608,7 +626,7 @@ export default { }, - /** 查询岗位列表 */ + /** 查询列表 */ getList() { this.loading = true; console.log(this.queryParams.month) @@ -624,6 +642,14 @@ export default { }) this.moneyAll = this.leaseAll + this.repairAll + this.scrapAll + this.loseAll; } + let obj = { + leaseMoney: this.leaseAll, + repairMoney: this.repairAll, + scrapMoney: this.scrapAll, + loseMoney: this.loseAll, + money: this.moneyAll, + } + this.pushReviewList.push(obj) this.loading = false; }); @@ -716,16 +742,16 @@ export default { this.dialogRepair.typeName = "" this.dialogRepair.modelName = "" this.dialogRepair.id = row.id; - // this.getRepairList() + this.getRepairList() }, //查询维修费用 getRepairList() { this.loading = true; - // getRepairList(this.dialogRepaire).then((response) => { - // this.dialogRepairList = response.rows; - // this.dialogRepairTotal = response.total; - // this.loading = false; - // }); + getRepairList(this.dialogRepaire).then((response) => { + this.dialogRepairList = response.rows; + this.dialogRepairTotal = response.total; + this.loading = false; + }); }, handleQueryRepair() { this.getRepairList() @@ -748,16 +774,16 @@ export default { this.dialogScrap.typeName = "" this.dialogScrap.modelName = "" this.dialogScrap.id = row.id; - // this.getScrapList() + this.getScrapList() }, //查询报废费用 getScrapList() { this.loading = true; - // getScrapList(this.dialogScrap).then((response) => { - // this.dialogScrapList = response.rows; - // this.dialogScrapTotal = response.total; - // this.loading = false; - // }); + getScrapList(this.dialogScrap).then((response) => { + this.dialogScrapList = response.rows; + this.dialogScrapTotal = response.total; + this.loading = false; + }); }, handleQueryScrap() { this.getScrapList() @@ -780,16 +806,16 @@ export default { this.dialogLose.typeName = "" this.dialogLose.modelName = "" this.dialogLose.id = row.id; - // this.getLoseList() + this.getLoseList() }, //查询丢失费用 getLoseList() { this.loading = true; - // getLoseList(this.dialogLose).then((response) => { - // this.dialogLoseList = response.rows; - // this.dialogLoseTotal = response.total; - // this.loading = false; - // }); + getLoseList(this.dialogLose).then((response) => { + this.dialogLoseList = response.rows; + this.dialogLoseTotal = response.total; + this.loading = false; + }); }, handleQueryLose() { this.getLoseList() @@ -805,13 +831,13 @@ export default { }, /** 外层导出 */ handleExport() { - // this.download( - // 'material/complex_query/exportOutRecord', - // { - // ...this.queryParams, - // }, - // `费用推送审核记录_${new Date().getTime()}.xlsx`, - // ) + this.download( + 'material/iws_cost_push/exportCostPushExamList', + { + ...this.queryParams, + }, + `费用推送审核记录_${new Date().getTime()}.xlsx`, + ) }, /** 提交 */ @@ -840,7 +866,27 @@ export default { // }) }) .catch(() => {}) - } + }, + + // 合并单元格 rowIndex=行数 columnIndex=列数 + // 这里是合并table的除表头外的第一行的第二列 + 除表头外的第二行的第二列 + // 注意列数和行数从 0 开始 + objectSpanMethod ({ row, column, rowIndex, columnIndex }) { + if (rowIndex === this.pushReviewList.length-1 && columnIndex == 1) { + let rowspan = 2 + let colspan = 6 + return { rowspan, colspan } + } + // 解决偏移的重要代码 + // 重点在 else if 判断必须加因为合并单元格数据会出现偏移、 + // 否则如果是 第二行 的 第二列 那么隐藏原有第二行 的 第二列的数据使他隐藏 + else if (rowIndex === this.pushReviewList.length-1 && columnIndex < 6) { + return { + rowspan: 0, + colspan: 0 + } + } + }, }, }; diff --git a/src/views/material/lease/apply/component/addToolsApply.vue b/src/views/material/lease/apply/component/addToolsApply.vue index c9f3aa8b..7cae6a50 100644 --- a/src/views/material/lease/apply/component/addToolsApply.vue +++ b/src/views/material/lease/apply/component/addToolsApply.vue @@ -154,6 +154,43 @@ rows="2" /> + + + + +
+ +
+ +

{{ file.name }}

+
+ + + + + + + + + + + +
+ +
+
@@ -232,6 +269,11 @@ + + + + +
@@ -253,7 +295,7 @@ import { uploadPurchaseFile, getPurchaseFileList, } from "@/api/purchase/goodsAccept"; - +import {downloadFile, downloadFileData} from '@/utils/download' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' @@ -370,6 +412,13 @@ export default { trigger: "blur", }, ], + fileFbs: [ + { + required: false,//是否分包商(是:合同编号必填) + message: '请上传委托书', + trigger: 'change' + } + ], // purchaser: [ // { required: true, message: "采购员不能为空", trigger: "blur" } // ] @@ -404,9 +453,30 @@ export default { matchedOptions: [], // 匹配的选项 keepSelectOpen: false, // 控制下拉框是否保持打开 isSearching: false, // 添加搜索状态标记 + + //是否是分包商 + isFileFbs:false, + businessLicenseListTemp: [], + urlTemp: '', + delBusinessFileIdList: [], + //图片查看弹窗 + dialogImageUrl: '', + dialogVisible: false, + uploadKey: Date.now(), + //上传 + upload: { + // 设置上传的请求头部 + headers: {Authorization: 'Bearer ' + getToken()}, + // 上传的地址 + url: process.env.VUE_APP_BASE_API + '/file/upload' + }, }; }, computed: { + //图片上传1张后,隐藏上传框 + uploadDisabled() { + return this.businessLicenseListTemp.length > 4 + }, pickerOptions() { return { disabledDate(time) { @@ -449,6 +519,13 @@ export default { // } else if (val && val.length == 0) { // this.maForm.unitId = ""; // } + if(val.typeKey=='fbs'){ + this.isFileFbs=true; + this.rules['fileFbs'][0].required=true; + }else{ + this.isFileFbs=false; + this.rules['fileFbs'][0].required=false; + } setTimeout(()=>{ getListProject({ unitId: this.maForm.unitId }).then((response) => { this.projectList = response.data; @@ -648,6 +725,10 @@ export default { // console.log(this.equipmentList) console.log("maForm", this.maForm); if (this.equipmentList.length > 0) { + if(this.businessLicenseListTemp.length > 0){ + console.log(33333333333333333333333333333333333) + this.$refs["maForm"].clearValidate('fileFbs'); + } this.$refs["maForm"].validate(async (valid) => { if (valid) { for(let i = 0;i { + return item.uid != file.uid + }); + const parts = file.name.split('.'); + const extension = parts.pop(); + if (fileList.length > 5) { + this.$message.warning('最多上传5张附件') + fileList = fileList.filter(item => { + return item.uid != file.uid + }) + } else if (!(extension === 'pdf' || extension === 'png' || extension === 'jpg' || extension === 'jpeg')) { + this.$message.warning('文件格式不正确') + fileList = fileList.filter(item => { + return item.uid != file.uid + }) + } else if (file.size > 1024 * 1024 * 10) { + this.$message.warning('文件大小不能超过10Mb') + fileList = fileList.filter(item => { + return item.uid != file.uid + }) + } else if (file.name.length > 40) { + this.$message.warning('文件名长度不能超过40个字符') + fileList = fileList.filter(item => { + return item.uid != file.uid + }) + } else if (fileListTemp.some(item => item.name === file.name)) { + this.$message.warning('文件名重复') + fileList = fileList.filter(item => { + return item.uid != file.uid + }) + } + fileList.forEach(file => { + if (extension === 'pdf') { + this.urlTemp = require('../../../../../assets/file.png'); + + } + }); + this.businessLicenseListTemp = fileList; + // // 根据 businessLicenseListTemp 是否有值来控制 fileFbs 的验证 + // if (this.businessLicenseListTemp.length > 0) { + // // this.maForm.fileFbs = fileList.map(item => item.raw); // 假设需要上传文件对象; + // // 有值,手动标记验证通过 + // console.log('222222222222222') + // this.$refs.maForm.clearValidate('fileFbs'); + // } else { + // // maForm.fileFbs = false; + // console.log('33333333') + // // 无值,手动触发验证失败 + // this.$refs.maForm.validateField('fileFbs'); + // } + + console.log('4444444444') + }, + + isImage(file) { + this.urlTemp = require('@/assets/file.png'); + if (this.updataIf(file)) { + return false + } else { + return true + } + }, + + // 判断文件类型,图片预览,文件下载 + updataIf(e) { + if (e.fileName) { + const parts = e.fileName.split('.'); + const extension = parts.pop(); + if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') { + return false + } else { + return true + } + } else { + const parts = e.name.split('.'); + const extension = parts.pop(); + if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') { + return false + } else { + return true + } + } + }, + + //上传组件-图片查看 + picturePreviewFbs(file) { + this.dialogImageUrl = file.url.replaceAll('#','%23'); + const parts = file.name.split('.'); + const extension = parts.pop(); + if (extension === 'pdf') { + const windowName = file.name; + window.open(file.url, windowName) + } else { + this.dialogVisible = true + } + }, + + //上传组件-图片删除 + handleRemoveElectricianImgList(file, fileList) { + let sum = 0 + this.businessLicenseListTemp.forEach((item, index) => { + if (item.uid == file.uid) { + sum = index + } + }) + this.businessLicenseListTemp.splice(sum, 1) + if (file.status == 'success') { + this.delBusinessFileIdList.push(file.url); + } + console.log('delBusinessFileIdList', this.delBusinessFileIdList) + }, + + handleDownload(file) { + console.log(file) + if (file.status === 'ready') { + downloadFile({fileName: file.name, fileData: file.raw, fileType: 'application/vnd.ms-excel;charset=utf-8'}) + } else if (file.status === 'success') { + + downloadFileData({fileName: file.name, fileUrl: file.url}) + // downloadFileData({ fileName: file.name,fileUrl:file.url }) + } + }, + // 高亮文本 highlightText(text, keyword) { if (!keyword) return text; @@ -948,7 +1156,21 @@ export default { } }; - diff --git a/src/views/material/lease/apply/component/homeApply.vue b/src/views/material/lease/apply/component/homeApply.vue index f248ea5b..1f629ce3 100644 --- a/src/views/material/lease/apply/component/homeApply.vue +++ b/src/views/material/lease/apply/component/homeApply.vue @@ -159,11 +159,11 @@
+ style="width: 60%;flex-shrink: 0;margin-bottom: 5px;font-size: 14px;"> 领用工程: {{ checkDataInfo.leaseProject }}
-
+
使用单位: {{ checkDataInfo.leaseUnit }}
@@ -189,7 +189,7 @@ 检验单位:
- +
@@ -517,7 +517,7 @@ export default { this.printTableData = res.data.leaseOutVoList; setTimeout(() => { - this.chapter('检验专用章', '机具设备分公司') + this.chapter('机具检验专用章', '安徽送边电工程有限公司机具(物流)分公司') }, 500); this.openPrint = true; this.title = "出库检验单"; @@ -663,16 +663,16 @@ export default { this.create5star(context, width, height, 20, "#f00", 0); // 绘制印章名称 - context.font = "18px 宋体"; + context.font = "100 13px 宋体"; context.textBaseline = "middle"; //设置文本的垂直对齐方式 context.textAlign = "center"; //设置文本的水平对对齐方式 - context.lineWidth = 1; - context.strokeStyle = "#ff2f2f"; + context.lineWidth = 0.7; + context.strokeStyle = "#ff2323"; context.strokeText(text, width, height + 50); // 绘制印章单位 context.translate(width, height); // 平移到此位置, - context.font = "16px 宋体"; + context.font = "100 13px 宋体"; let count = companyName.length; // 字数 let angle = (4 * Math.PI) / (3 * (count - 1)); // 字间角度 let chars = companyName.split(""); @@ -688,7 +688,7 @@ export default { context.save(); context.translate(65, 0); // 平移到此位置,此时字和x轴垂直,公司名称和最外圈的距离 context.rotate(Math.PI / 2); // 旋转90度,让字平行于x轴 - context.strokeStyle = "#ff5050"; // 设置印章单位字体颜色为较浅的红色 + context.strokeStyle = "#ff2323"; // 设置印章单位字体颜色为较浅的红色 context.strokeText(c, 0, 0); // 此点为字的中心点 context.restore(); } diff --git a/src/views/material/lease/protocol/index.vue b/src/views/material/lease/protocol/index.vue index 35b9d0c7..c8a7ba7b 100644 --- a/src/views/material/lease/protocol/index.vue +++ b/src/views/material/lease/protocol/index.vue @@ -269,7 +269,7 @@ -
+
@@ -303,7 +303,6 @@
- @@ -608,7 +607,7 @@ export default { //图片上传1张后,隐藏上传框 uploadDisabled() { - return this.businessLicenseListTemp.length > 2 + return this.businessLicenseListTemp.length > 9 }, }, created() { @@ -721,8 +720,8 @@ export default { }); const parts = file.name.split('.'); const extension = parts.pop(); - if (fileList.length > 3) { - this.$message.warning('最多上传3张附件') + if (fileList.length > 10) { + this.$message.warning('最多上传10张附件') fileList = fileList.filter(item => { return item.uid != file.uid }) @@ -1212,9 +1211,10 @@ export default { } } -::v-deep .el-upload-list--picture-card { - display: flex; -} +// ::v-deep .el-upload-list--picture-card { +// display: flex; +// flex-wrap: wrap; +// } ::v-deep .el-upload-list__item { margin-bottom: 20px; @@ -1224,9 +1224,14 @@ export default { ::v-deep .el-upload-list__item-actions { overflow: hidden; } +.el-upload--picture-card { + display: flex; + flex-wrap: wrap; +} .upload-demo { display: flex; + flex-wrap: wrap; } .el-upload-list__item-thumbnail { diff --git a/src/views/material/repair/repairManage/component/edit.vue b/src/views/material/repair/repairManage/component/edit.vue index 95f4a5e5..13a59c47 100644 --- a/src/views/material/repair/repairManage/component/edit.vue +++ b/src/views/material/repair/repairManage/component/edit.vue @@ -838,7 +838,7 @@ export default { computed: { //图片上传1张后,隐藏上传框 uploadDisabled() { - return this.fileList.length > 2; + return this.fileList.length > 4; }, ...mapState(["user"]), },