From da3678aae94a4153fa124be85d522df3ebfe9294 Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Tue, 20 Jan 2026 19:18:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=B4=AD=E5=85=A5=E5=BA=93=EF=BC=8C?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E5=85=A5=E5=BA=93=E9=A1=B5=E9=9D=A2=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0loding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/purchase/goodsEntry.js | 2 +- .../material/purchase/goodsEntry/detail.vue | 75 +++++++++++-------- 2 files changed, 46 insertions(+), 31 deletions(-) diff --git a/src/api/purchase/goodsEntry.js b/src/api/purchase/goodsEntry.js index 88ac27fb..589ae2c0 100644 --- a/src/api/purchase/goodsEntry.js +++ b/src/api/purchase/goodsEntry.js @@ -32,7 +32,7 @@ export function rejectPurchaseWarehouse(data) { // 查询入库编码列表 export function getMachineById(query) { return request({ - url: '/material/purchase/storage/getMachineById', + url: '/material/purchase/storage/getMachineList', method: 'get', params: query }) diff --git a/src/views/material/purchase/goodsEntry/detail.vue b/src/views/material/purchase/goodsEntry/detail.vue index 762ca91b..c5108694 100644 --- a/src/views/material/purchase/goodsEntry/detail.vue +++ b/src/views/material/purchase/goodsEntry/detail.vue @@ -424,12 +424,12 @@ export default { console.log(selection) this.inPutList = selection.map(item => {return {'maCode':item.maCode}}) }, - //编码入库 + //编码入库 - 新增加载状态 codeWarehouse(){ if(this.inPutList.length>0){ let obj = { taskId: this.taskId, - typeId:this.codeRowData.typeId, + typeId: this.codeRowData.typeId, purchaseId: this.codeRowData.id, inPutList: this.inPutList, typeName: this.codeRowData.maTypeName, @@ -443,14 +443,24 @@ export default { }; console.log(obj) this.$modal.confirm('是否确认新购入库勾选的编码?') - .then(function() { + .then(() => { + // 1. 开启全局加载状态 + const loading = this.$loading({text: '提交中...'}) + + // 2. 调用入库接口 return purchaseWarehouse(obj) + .finally(() => { + // 3. 无论成功失败,都关闭加载状态 + loading.close() + }) }).then(() => { - this.openCode=false + this.openCode = false this.getList() this.$modal.msgSuccess('入库成功') - }).catch(() => {}); - }else{ + }).catch(() => { + this.$modal.msgError('入库失败,请重试') + }); + } else { this.$modal.msgError('请先勾选入库编码!') } }, @@ -458,27 +468,28 @@ export default { reject(row) { let obj = { taskId: this.taskId, - typeId:row.typeId, + typeId: row.typeId, purchaseId: row.id }; this.$modal.confirm('是否确认驳回该物资类型?') - .then(function() { + .then(function () { console.log(obj) return rejectPurchaseWarehouse(obj) }).then(() => { this.$modal.msgSuccess('驳回成功') this.getList() - }).catch(() => {}); + }).catch(() => { + }); }, //文件管理 - async openFileDialog(row){ - this.rowData=row; + async openFileDialog(row) { + this.rowData = row; this.fileDataList = [ - { dictLabel: '合格证', fileType: '0', name: '', url: '', fileList: [], fileListTemp: [] }, - { dictLabel: '型式试验报告', fileType: '1', name: '', url: '', fileList: [], fileListTemp: [] }, - { dictLabel: '出厂检测报告', fileType: '2', name: '', url: '', fileList: [], fileListTemp: [] }, - { dictLabel: '第三方检测报告', fileType: '3', name: '', url: '', fileList: [], fileListTemp: [] }, - { dictLabel: '其他', fileType: '4', name: '', url: '', fileList: [], fileListTemp: [] } + {dictLabel: '合格证', fileType: '0', name: '', url: '', fileList: [], fileListTemp: []}, + {dictLabel: '型式试验报告', fileType: '1', name: '', url: '', fileList: [], fileListTemp: []}, + {dictLabel: '出厂检测报告', fileType: '2', name: '', url: '', fileList: [], fileListTemp: []}, + {dictLabel: '第三方检测报告', fileType: '3', name: '', url: '', fileList: [], fileListTemp: []}, + {dictLabel: '其他', fileType: '4', name: '', url: '', fileList: [], fileListTemp: []} ] if (this.rowData.bmFileInfos == null) { await this.getFileData() @@ -514,13 +525,13 @@ export default { }) } } - this.open=true + this.open = true }, - async getFileData(){ + async getFileData() { let param = { - modelId:this.rowData.typeId, - taskType:0, - taskId:this.rowData.taskId + modelId: this.rowData.typeId, + taskType: 0, + taskId: this.rowData.taskId } this.rowData.bmFileInfos = [] await getPurchaseFileList(param) @@ -543,14 +554,15 @@ export default { }) } }) - .catch(() => {}) + .catch(() => { + }) }, - beforeFileUpload(row){ - this.rowData.fileType=row.fileType; + beforeFileUpload(row) { + this.rowData.fileType = row.fileType; }, // 文件上传成功处理 handleFileSuccess(response, file, fileList) { - if(response.code==200){ + if (response.code == 200) { let param = { "taskId": this.taskId, "taskType": "0", @@ -582,13 +594,13 @@ export default { }, //图片查看 picturePreview(file) { - this.dialogImageUrl = file.url.replaceAll('#','%23'); + this.dialogImageUrl = file.url.replaceAll('#', '%23'); const parts = file.name.split('.'); const extension = parts.pop(); - if(extension === 'doc' || extension === 'DOC' || extension === 'docx' || extension === 'DOCX' || extension === 'pdf' || extension === 'PDF'){ + if (extension === 'doc' || extension === 'DOC' || extension === 'docx' || extension === 'DOCX' || extension === 'pdf' || extension === 'PDF') { const windowName = file.name; - window.open(file.url,windowName) - }else{ + window.open(file.url, windowName) + } else { this.dialogVisible = true } }, @@ -606,7 +618,7 @@ export default { const currentTime = formatTime(new Date()); this.download( "/material/purchase_check_info/exportDetails", - { taskId: this.taskId,taskStage:4,id:this.Id }, + {taskId: this.taskId, taskStage: 4, id: this.Id}, `新购入库详情_${currentTime}.xlsx` ); }, @@ -620,15 +632,18 @@ export default { align-items: center; justify-content: center; } + .deviceCode { margin-top: 10px; padding-bottom: 20px; font-size: 18px; } + ::v-deep.el-table .fixed-width .el-button--mini { width: 60px !important; margin-bottom: 10px; } + //隐藏图片上传框的css ::v-deep.disabled { .el-upload--picture-card {