新购入库,编码入库页面增加loding

This commit is contained in:
hayu 2026-01-20 19:18:44 +08:00
parent 0192a021f8
commit da3678aae9
2 changed files with 46 additions and 31 deletions

View File

@ -32,7 +32,7 @@ export function rejectPurchaseWarehouse(data) {
// 查询入库编码列表 // 查询入库编码列表
export function getMachineById(query) { export function getMachineById(query) {
return request({ return request({
url: '/material/purchase/storage/getMachineById', url: '/material/purchase/storage/getMachineList',
method: 'get', method: 'get',
params: query params: query
}) })

View File

@ -424,12 +424,12 @@ export default {
console.log(selection) console.log(selection)
this.inPutList = selection.map(item => {return {'maCode':item.maCode}}) this.inPutList = selection.map(item => {return {'maCode':item.maCode}})
}, },
// // -
codeWarehouse(){ codeWarehouse(){
if(this.inPutList.length>0){ if(this.inPutList.length>0){
let obj = { let obj = {
taskId: this.taskId, taskId: this.taskId,
typeId:this.codeRowData.typeId, typeId: this.codeRowData.typeId,
purchaseId: this.codeRowData.id, purchaseId: this.codeRowData.id,
inPutList: this.inPutList, inPutList: this.inPutList,
typeName: this.codeRowData.maTypeName, typeName: this.codeRowData.maTypeName,
@ -443,14 +443,24 @@ export default {
}; };
console.log(obj) console.log(obj)
this.$modal.confirm('是否确认新购入库勾选的编码?') this.$modal.confirm('是否确认新购入库勾选的编码?')
.then(function() { .then(() => {
// 1.
const loading = this.$loading({text: '提交中...'})
// 2.
return purchaseWarehouse(obj) return purchaseWarehouse(obj)
.finally(() => {
// 3.
loading.close()
})
}).then(() => { }).then(() => {
this.openCode=false this.openCode = false
this.getList() this.getList()
this.$modal.msgSuccess('入库成功') this.$modal.msgSuccess('入库成功')
}).catch(() => {}); }).catch(() => {
}else{ this.$modal.msgError('入库失败,请重试')
});
} else {
this.$modal.msgError('请先勾选入库编码!') this.$modal.msgError('请先勾选入库编码!')
} }
}, },
@ -458,27 +468,28 @@ export default {
reject(row) { reject(row) {
let obj = { let obj = {
taskId: this.taskId, taskId: this.taskId,
typeId:row.typeId, typeId: row.typeId,
purchaseId: row.id purchaseId: row.id
}; };
this.$modal.confirm('是否确认驳回该物资类型?') this.$modal.confirm('是否确认驳回该物资类型?')
.then(function() { .then(function () {
console.log(obj) console.log(obj)
return rejectPurchaseWarehouse(obj) return rejectPurchaseWarehouse(obj)
}).then(() => { }).then(() => {
this.$modal.msgSuccess('驳回成功') this.$modal.msgSuccess('驳回成功')
this.getList() this.getList()
}).catch(() => {}); }).catch(() => {
});
}, },
// //
async openFileDialog(row){ async openFileDialog(row) {
this.rowData=row; this.rowData = row;
this.fileDataList = [ this.fileDataList = [
{ dictLabel: '合格证', fileType: '0', name: '', url: '', fileList: [], fileListTemp: [] }, {dictLabel: '合格证', fileType: '0', name: '', url: '', fileList: [], fileListTemp: []},
{ dictLabel: '型式试验报告', fileType: '1', name: '', url: '', fileList: [], fileListTemp: [] }, {dictLabel: '型式试验报告', fileType: '1', name: '', url: '', fileList: [], fileListTemp: []},
{ dictLabel: '出厂检测报告', fileType: '2', name: '', url: '', fileList: [], fileListTemp: [] }, {dictLabel: '出厂检测报告', fileType: '2', name: '', url: '', fileList: [], fileListTemp: []},
{ dictLabel: '第三方检测报告', fileType: '3', name: '', url: '', fileList: [], fileListTemp: [] }, {dictLabel: '第三方检测报告', fileType: '3', name: '', url: '', fileList: [], fileListTemp: []},
{ dictLabel: '其他', fileType: '4', name: '', url: '', fileList: [], fileListTemp: [] } {dictLabel: '其他', fileType: '4', name: '', url: '', fileList: [], fileListTemp: []}
] ]
if (this.rowData.bmFileInfos == null) { if (this.rowData.bmFileInfos == null) {
await this.getFileData() await this.getFileData()
@ -514,13 +525,13 @@ export default {
}) })
} }
} }
this.open=true this.open = true
}, },
async getFileData(){ async getFileData() {
let param = { let param = {
modelId:this.rowData.typeId, modelId: this.rowData.typeId,
taskType:0, taskType: 0,
taskId:this.rowData.taskId taskId: this.rowData.taskId
} }
this.rowData.bmFileInfos = [] this.rowData.bmFileInfos = []
await getPurchaseFileList(param) await getPurchaseFileList(param)
@ -543,14 +554,15 @@ export default {
}) })
} }
}) })
.catch(() => {}) .catch(() => {
})
}, },
beforeFileUpload(row){ beforeFileUpload(row) {
this.rowData.fileType=row.fileType; this.rowData.fileType = row.fileType;
}, },
// //
handleFileSuccess(response, file, fileList) { handleFileSuccess(response, file, fileList) {
if(response.code==200){ if (response.code == 200) {
let param = { let param = {
"taskId": this.taskId, "taskId": this.taskId,
"taskType": "0", "taskType": "0",
@ -582,13 +594,13 @@ export default {
}, },
// //
picturePreview(file) { picturePreview(file) {
this.dialogImageUrl = file.url.replaceAll('#','%23'); this.dialogImageUrl = file.url.replaceAll('#', '%23');
const parts = file.name.split('.'); const parts = file.name.split('.');
const extension = parts.pop(); 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; const windowName = file.name;
window.open(file.url,windowName) window.open(file.url, windowName)
}else{ } else {
this.dialogVisible = true this.dialogVisible = true
} }
}, },
@ -606,7 +618,7 @@ export default {
const currentTime = formatTime(new Date()); const currentTime = formatTime(new Date());
this.download( this.download(
"/material/purchase_check_info/exportDetails", "/material/purchase_check_info/exportDetails",
{ taskId: this.taskId,taskStage:4,id:this.Id }, {taskId: this.taskId, taskStage: 4, id: this.Id},
`新购入库详情_${currentTime}.xlsx` `新购入库详情_${currentTime}.xlsx`
); );
}, },
@ -620,15 +632,18 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.deviceCode { .deviceCode {
margin-top: 10px; margin-top: 10px;
padding-bottom: 20px; padding-bottom: 20px;
font-size: 18px; font-size: 18px;
} }
::v-deep.el-table .fixed-width .el-button--mini { ::v-deep.el-table .fixed-width .el-button--mini {
width: 60px !important; width: 60px !important;
margin-bottom: 10px; margin-bottom: 10px;
} }
//css //css
::v-deep.disabled { ::v-deep.disabled {
.el-upload--picture-card { .el-upload--picture-card {