From b3c1870869e1445a36565386d5b67962b56b4efb Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Tue, 19 Nov 2024 10:42:45 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=BB=B4=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/repair/repair.js | 16 +- .../repair/repairManage/component/edit.vue | 2630 +++++++++++------ .../repair/repairManage/component/home.vue | 261 ++ 3 files changed, 2040 insertions(+), 867 deletions(-) diff --git a/src/api/repair/repair.js b/src/api/repair/repair.js index 293c06ee..0407887a 100644 --- a/src/api/repair/repair.js +++ b/src/api/repair/repair.js @@ -22,12 +22,13 @@ export function getAppRepairMaTypeList(query) { //获取配件类型树 export function partTypeTreeList(query) { return request({ - url: '/material/ma_part_type/list', - method: 'get', - params: query, + url: '/material/ma_part_type/list', + method: 'get', + params: query, }) } + // //维修驳回至退料 // export function rejectRepair(data) { // return request({ @@ -44,3 +45,12 @@ export function rejectRepair(taskIds) { }) } +// 维修保存 +export function saveCodeList(data) { + return request({ + url: '/material/repair/batchRepairApply', + method: 'post', + data: data, + }) +} + diff --git a/src/views/material/repair/repairManage/component/edit.vue b/src/views/material/repair/repairManage/component/edit.vue index 15cddcb2..c750be97 100644 --- a/src/views/material/repair/repairManage/component/edit.vue +++ b/src/views/material/repair/repairManage/component/edit.vue @@ -1,896 +1,1798 @@ @@ -109,6 +110,230 @@ :limit.sync="queryParams.pageSize" @pagination="getList" /> + + + +
+ +
+ 机具设备维修任务单 +
+
+
+ 日期: +
+
+ 单号: +
+
+ 承修单位: +
+ +
+ 操作人: +
+ +
+ 项目名称: +
+ +
+ 委托单位: +
+ +
+ 验收人: +
+
+ + + + + + + + + + + + +
+
总计
+
报修数量
+
修复数量
+
报废数量
+
维修费小计
+
+
+
+
+ 维修内容 +
+
+
+ + + + + + + +
+
合计
+
合计金额
+
+ +
+
报废图片
+
试验记录
+
+ +
+
+
+ 负责人: +
+
+ +
+
+ 完成日期: +
+
+ +
+ +
+
+
+ 维修人员: +
+
+ +
+
+ 试验人员: +
+
+ +
+
+ 检验人员: +
+
+
+
+
+ + +
@@ -120,6 +345,8 @@ import { } from '@/api/repair/repair.js' import { getInfo, h } from '@/api/login' + + import vueEasyPrint from "vue-easy-print"; export default { name: '', dicts: ['back_task_status'], @@ -163,6 +390,8 @@ export default { companyId: '', unitList: [], proList: [], + //维修单显示 + openPrint:false, } }, created() { @@ -170,6 +399,7 @@ export default { // this.initSelectData() // this.InitIGetInfo() }, + components: { vueEasyPrint }, methods: { //人员信息 InitIGetInfo() { @@ -249,6 +479,12 @@ export default { `维修任务单_${new Date().getTime()}.xlsx`, ) }, + //查看维修任务单 + handlePrint(row) { + this.openPrint = true; + this.title = "机具设备维修任务单"; + }, + }, } @@ -300,4 +536,29 @@ export default { justify-content: flex-end; align-items: center; } +.tabelAll { + display: flex; + border: 1px solid #dfe6ec; + margin-bottom: 1px; + width:1000px; + border-bottom: 1px solid #dfe6ec; + border-top: none; +} +.columnAll { + flex: 1; + padding: 5px; + border-left: 1px solid #dfe6ec; + text-align: center; + width:20%; +} +.columnAllNum { + padding: 5px; + text-align: center; + width:50%; + border-left: none; +} +/* 最后一列无右边框 */ +.tabelAll .column:last-child { + border-right: none; +} From 19f85a82a5e8d4cf9ce8d2db55884f88cf296117 Mon Sep 17 00:00:00 2001 From: lSun <15893999301@qq.com> Date: Tue, 19 Nov 2024 11:12:52 +0800 Subject: [PATCH 2/5] =?UTF-8?q?lsun=20=E5=8D=8F=E8=AE=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?-=E6=A0=91=E7=BB=93=E6=9E=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/material/lease/protocol/index.vue | 511 +++++++++++++------- 1 file changed, 328 insertions(+), 183 deletions(-) diff --git a/src/views/material/lease/protocol/index.vue b/src/views/material/lease/protocol/index.vue index 1222ad85..ba369b6d 100644 --- a/src/views/material/lease/protocol/index.vue +++ b/src/views/material/lease/protocol/index.vue @@ -1,7 +1,7 @@ @@ -250,7 +250,7 @@ 保存 - 取消 @@ -538,10 +538,10 @@ :inline="true" label-width="100px" > - + + - + - - + + + @@ -750,6 +751,7 @@ maxlength="20" type="number" style="width: 265px" + @input="waitRepairCount" /> @@ -880,25 +882,10 @@ maxlength="20" type="number" style="width: 250px" + @input="waitRepairCount" /> - - - - - - + - - - - -
- 将文件拖到此处,或点击上传 -
- -
+ > +
+ + + + + @@ -959,7 +944,7 @@ align-items: center; " > - 保存 { + // const regex = /^[+-]?(0|[1-9]\d*)(\.\d+)?$/; + // if(!regex.test(value)){ + // return callback(new Error('请勿输入非数字')); + // } + // const pat = parseFloat(value); + // console.log('pat',pat) + // if(pat.toString().includes('.')==true){ + // if (pat <0 ||pat.toString().split(".")[1].length>6) { + // callback(new Error('请必须输入大于0的数据且小数点后最多保留六位')); + // } else { + // callback(); + // } + // }else{ + // if (pat<0) { + // callback(new Error('请必须输入大于0的数据且小数点后最多保留六位')); + // }else{ + // callback(); + // } + // } + // }, + // trigger: 'blur' + // } + ] + }, + rulesRight: { + scrapNum: [ + { + required: true, + message: "请输入返厂维修数量", + trigger: "blur", + }, + ], + + scrapType: [ + { + required: true, + message: "请选择损坏原因", + trigger: "change", + }, + ], + scrapReason: [ + { + required: true, + message: "请输入报废原因", + trigger: "blur", + }, + ], + }, + + //文件数组 fileList: [], + //暂存的文件数组 + fileListTemp:[], + typeTemp: "", typeNameTemp: "", - typeeTmp: "", + //待维修数量 disrepairNumTemp: undefined, + //数量维修是否能保存 + flagSave: false, + //合格勾选对象数组 + idsList:[], }; }, mounted() { @@ -1193,31 +1267,42 @@ export default { // 多选框选中数据 handleSelectionChange(selection) { this.queryParams.equipmentList = selection; + this.idsList = []; + this.ids = selection.map((item) => item.id); + selection.forEach((item) => { + this.idsList.push(item.id); + }); + this.single = selection.length != 1; + this.multiple = !selection.length; }, /** 批量合格按钮操作 */ handleAdd() { - if (this.queryParams.equipmentList.length == 0) { - this.$message.error("请先勾选数据"); - return; + if (this.ids.length == 0) { + this.$alert("请至少勾选一条数据", "提示", { + type: "warning", + confirmButtonText: "确定", + }); + }else{ + auditPass(this.idsList).then((response) => { + if (response.code == 200) { + this.$modal.msgSuccess("通过成功"); + } + }); } - console.log(this.queryParams); - // this.queryParams.backApplyInfo = { - // remark: this.queryParams.remark, - // agreementId: this.queryParams.agreementId, - // backTime: this.queryParams.backTime, - // } - // let params = { - // backApplyInfo: this.queryParams.backApplyInfo, - // backApplyDetailsList: - // this.queryParams.equipmentList, - // } - // const res = await editBackApply(params) - // if (res.code == 200) { - // this.$message({ type: 'success', message: res.msg }) - // setTimeout(() => { - // this.$emit('goBackPage') - // }, 1000) - // } + }, + //单个合格按钮操作 + handleAddSingle(row){ + const ids = []; + ids.push(row.id); + this.$modal + .confirm("是否确认合格所选择的数据项?") + .then(function () { + return auditPass(ids); + }) + .then(() => { + this.$modal.msgSuccess("合格成功"); + }) + .catch(() => {}); }, //是否可用勾选框 selectable(row) { @@ -1287,43 +1372,6 @@ export default { this.openNum = true; }); } - // this.repairRowData = row; - // this.repairDeviceList = []; - // this.repairRowData.repairDeviceList = [ - // { - // materialName: "速差自控器", - // typeName: "G-J-10", - // maId: "1", - // maCode: "W202407-00001", - // maStatus: "待修", - // apDetection: "", - // partTableList: [], - // backTableList: [], - // bmFileInfos: [], - // }, - // { - // materialName: "速差自控器", - // typeName: "G-J-10", - // maId: "2", - // maCode: "W202407-00002", - // maStatus: "待修", - // apDetection: "", - // partTableList: [], - // backTableList: [], - // bmFileInfos: [], - // }, - // { - // materialName: "速差自控器", - // typeName: "G-J-10", - // maId: "3", - // maCode: "W202407-00003", - // maStatus: "待修", - // apDetection: "", - // partTableList: [], - // backTableList: [], - // bmFileInfos: [], - // }, - // ]; if ( this.repairRowData.repairDeviceList && this.repairRowData.repairDeviceList.length > 0 @@ -1341,12 +1389,12 @@ export default { }, // 编码维修弹窗保存 saveCodeDialog() { - console.log(this.repairRowData); - console.log(this.repairDeviceList); this.repairRowData.repairDeviceList = this.repairDeviceList; saveCodeList(this.repairRowData.repairDeviceList).then((response) => { if (response.code == 200) { this.$modal.msgSuccess("保存成功"); + this.fileList = []; + this.fileListTemp = []; } }); this.openCode = false; @@ -1397,8 +1445,6 @@ export default { }, // 图片上传 handleChange(file, fileList) { - console.log(file); - console.log(fileList); if (this.beforeUpload(file) == false) { fileList.splice(fileList.length - 1, 1); } @@ -1429,25 +1475,66 @@ export default { }); this.fileList.splice(sum, 1); }, - // 保存按钮 - saveSubmit() { + // 待报废保存按钮 + async saveSubmit() { this.uploadKey = Date.now(); - scrapRowData; + if(this.fileList.length!=0){ + await this.getImaUpload(), + await this.addWaitRepairPic(this.scrapForm); + }else{ + await this.addWaitRepairPic(this.scrapForm); + } + this.scrapRowData.repairType = 3 + this.scrapRowData.codeScrapRepairPartList.push(this.scrapForm) + this.openScrap = false; - this.fileList = []; this.reset(); }, - // 取消按钮 + //上传文件库 + async getImaUpload(){ + this.fileListTemp = []; + const reqData = new FormData() + const {fileTwo} = await this.getFileData() + let res = await imgUpLoadThree(fileTwo); + console.log('res',res) + if (res.code === 200) { + res.data.forEach(item=>{ + let objTwo = { 'name': item.name, 'url': item.url,}; + this.fileListTemp.push(objTwo); + }) + } else { + this.$modal.msgError(res.msg); + } + }, + + //提交时循环fileList 获取raw文件 + async getFileData() { + const fileTwo = [] + this.fileList.forEach(item => { + if (item?.hasOwnProperty('raw')) { + fileTwo.push(item.raw) + } + }) + return { fileTwo } + }, + + async addWaitRepairPic(scrapForm){ + this.scrapForm.fileList=this.fileListTemp + this.openScrap = false; + + }, + + // 待报废取消按钮 saveCancel() { this.uploadKey = Date.now(); this.openScrap = false; this.fileList = []; - this.reset(); + this.fileListTemp = []; + this.resetForm("scrapForm"); }, + //内部维修 openInnerDialog(row) { - console.log("index", row.index); - console.log("index2", row); this.innerRowData = row; this.partTableList = []; if ( @@ -1558,8 +1645,6 @@ export default { }, //内部维修- 弹窗保存 saveInnerDialog() { - console.log(this.innerRowData); - console.log(this.partTableList); const isNum = this.partTableList.some( (item) => item.partNum == 0 || item.partNum == undefined ); @@ -1619,8 +1704,6 @@ export default { }, //返场维修- 弹窗保存 saveBackDialog() { - console.log(this.backRowData); - console.log(this.backTableList); if (this.backTableList.length > 0) { this.$refs["backForm"].validate((valid) => { if (valid) { @@ -1672,11 +1755,7 @@ export default { // 待报废-打开 openScrapDialog(row) { this.scrapRowData = row; - // if(this.scrapRowData.backTableList&&this.scrapRowData.backTableList.length>0){ - // this.scrapForm = this.scrapRowData.scrapForm; - // }else{ this.scrapForm = {}; - // } this.openScrap = true; }, // 待报废弹窗文件上传成功处理-编码弹窗上传 @@ -1716,6 +1795,8 @@ export default { //数量管理保存 saveNumAll() { + this.$refs["formLeft","formMiddle","formRight"].validate(async(valid)=>{ + if(valid){ for (let i = 0; i < this.partItems.length; i++) { this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({ isCharge: this.partItems[i].isCharge, @@ -1734,24 +1815,47 @@ export default { repairNum: this.formMiddle.repairNum, }); } - this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push({ - scrapReason: this.formRight.scrapReason, - scrapNum: this.formRight.scrapNum, - scrapType: this.formRight.scrapType, - otherReason: this.formRight.otherReason, - }) + this.uploadKey = Date.now(); + if(this.fileList.length!=0){ + await this.getImaUpload(), + this.formRight.fileList = this.fileListTemp; + }else{ + this.formRight.fileList = this.fileListTemp; + } + console.log('this.formRight',this.formRight) + this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight) this.innerRowData.repairDeviceList[0].repairType = 1; saveCodeList(this.innerRowData.repairDeviceList).then((response) => { if (response.code == 200) { this.$modal.msgSuccess("保存成功"); + this.fileList=[]; + this.fileListTemp=[]; this.openNum=false; } }); + } + }) }, //数量管理取消 saveCancelAll(){ + this.fileList=[]; + this.fileListTemp=[]; this.openNum=false; - } + }, + + //待维修数量限制统计 + waitRepairCount(){ + console.log('this.formLeft.repairNum',this.formLeft.repairNum) + console.log('this.formMiddle.repairNum',this.formMiddle.repairNum) + console.log('this.formRight.scrapNum',this.formRight.scrapNum) + console.log('this.disrepairNumTemp',this.disrepairNumTemp) + if((Number(this.formLeft.repairNum) + Number(this.formMiddle.repairNum)+ Number(this.formRight.scrapNum)) >this.disrepairNumTemp){ + this.flagSave = true; + this.$message.error("输入的数字之和大于"+this.disrepairNumTemp); + }else{ + this.flagSave = false; + } + }, }, }; diff --git a/src/views/material/repair/repairManage/component/home.vue b/src/views/material/repair/repairManage/component/home.vue index 1a5f6677..6ec3ef6e 100644 --- a/src/views/material/repair/repairManage/component/home.vue +++ b/src/views/material/repair/repairManage/component/home.vue @@ -30,7 +30,8 @@ placeholder="请选择" > 新增 --> - 提交 + 提交 退回 @@ -89,15 +90,15 @@ - + @@ -341,15 +342,16 @@ import { getRepairTaskList, - rejectRepair + rejectRepair, + sendList, } from '@/api/repair/repair.js' import { getInfo, h } from '@/api/login' - import vueEasyPrint from "vue-easy-print"; +import vueEasyPrint from "vue-easy-print"; export default { name: '', - dicts: ['back_task_status'], + dicts: ['repair_task_status'], data() { return { type: '', @@ -392,6 +394,10 @@ export default { proList: [], //维修单显示 openPrint:false, + printData: {}, + //选择的taskId数组 + ids:[], + taskList:[], } }, created() { @@ -438,12 +444,12 @@ export default { this.$refs.queryForm.resetFields() this.handleQuery() }, - // 多选框选中数据 - handleSelectionChange(selection) { - this.ids = selection.map((item) => item.taskId) - this.single = selection.length != 1 - this.multiple = !selection.length - }, + // // 多选框选中数据 + // handleSelectionChange(selection) { + // this.ids = selection.map((item) => item.taskId) + // this.single = selection.length != 1 + // this.multiple = !selection.length + // }, /** 新增按钮操作 */ handleAdd() { this.$emit('handelAdd') @@ -479,13 +485,40 @@ export default { `维修任务单_${new Date().getTime()}.xlsx`, ) }, - //查看维修任务单 + //查看维修任务单 handlePrint(row) { this.openPrint = true; this.title = "机具设备维修任务单"; }, + //提交 + handleSend(row){ + if (this.ids.length == 0) { + this.$alert("请至少勾选一条要提交的数据", "提示", { + type: "warning", + confirmButtonText: "确定", + }); + return; + } else { + sendList(this.taskList).then((response) => { + if (response.code == 200) { + this.$modal.msgSuccess("通过成功"); + } + this.getList() + }); + } + }, - }, + // 多选框选中数据 + handleSelectionChange(selection) { + this.taskList = []; + this.ids = selection.map((item) => item.taskId); + selection.forEach((item) => { + this.taskList.push({ taskId: item.taskId }); + }); + this.single = selection.length != 1; + this.multiple = !selection.length; + }, + }, }