From 693d5121316e5cd51563b99ac7c808b1364804e1 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Wed, 10 Dec 2025 19:40:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipmentInput/index.vue | 106 +++++++++++++++--- 1 file changed, 89 insertions(+), 17 deletions(-) diff --git a/src/views/EquipmentEntryApply/equipmentInput/index.vue b/src/views/EquipmentEntryApply/equipmentInput/index.vue index 909fcd38..b55a4a44 100644 --- a/src/views/EquipmentEntryApply/equipmentInput/index.vue +++ b/src/views/EquipmentEntryApply/equipmentInput/index.vue @@ -127,7 +127,13 @@ 新增装备 批量导入 - + 批量导入图片 @@ -370,13 +376,23 @@ > + {{ getFeatureValue(row, item.prop) }} {{ getFeatureValue(row, item.prop) }} @@ -787,16 +823,19 @@ export default { '导入结果', { dangerouslyUseHTMLString: true }, ) - this.$router.replace({ - query: { - orderId: response.data, - isAddVisible: this.isAddVisible, - isApprovalVisible: this.isApprovalVisible, - }, - }) - setTimeout(() => { - this.getList() - }, 200) + this.orderId = response.data + this.$router + .replace({ + query: { + orderId: response.data, + isAddVisible: this.isAddVisible, + isApprovalVisible: this.isApprovalVisible, + }, + }) + .then(() => { + console.log('🚀 ~ 导入成功跳转完成') + this.getList() + }) }, handleFileSuccess2(response, file, fileList) { this.upload.open2 = false @@ -927,8 +966,41 @@ export default { * 处理表单提交 */ handleSubmit() { - if (this.isSubmit) return + console.log('提交表单') + // 判断图片是否上传 + let hasMissing = false + for (const item of this.tableData) { + if (!item.appearanceImages?.length) { + this.$message({ + type: 'warning', + message: '请上传装备外观附件', + }) + hasMissing = true + break + } + + if (!item.certificates?.length) { + this.$message({ + type: 'warning', + message: '请上传装备合格证附件', + }) + hasMissing = true + break + } + + if (!item.inspectionReports?.length) { + this.$message({ + type: 'warning', + message: '请上传装备检验报告附件', + }) + hasMissing = true + break + } + } + if (hasMissing) return + this.isSubmit = true + if (this.isSubmit) return const loading = this.$loading() equipmentSubmitApiNew({ id: this.orderId, status: 0 }) .then((res) => { @@ -1130,7 +1202,7 @@ export default { this.download( `/material-mall/order/zip?orderId=${this.orderId}`, {}, - `装备信息图片导入模板_${new Date().getTime()}.zip`, + `批量导入图片模板_${new Date().getTime()}.zip`, ) }, async addList() {