From 4b1b13bbd2041a1d34703a7e8c66818242eafa61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=A5=89=E6=BA=90?= <1976974459@qq.com> Date: Tue, 17 Oct 2023 19:32:53 +0800 Subject: [PATCH] =?UTF-8?q?2023-10-17=20=E8=AE=BE=E5=A4=87=E5=92=8C?= =?UTF-8?q?=E8=B4=A8=E9=87=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/qc/IQCResultEntry.vue | 68 ++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 8 deletions(-) diff --git a/src/views/modules/qc/IQCResultEntry.vue b/src/views/modules/qc/IQCResultEntry.vue index 7dc4b4f..9bc130b 100644 --- a/src/views/modules/qc/IQCResultEntry.vue +++ b/src/views/modules/qc/IQCResultEntry.vue @@ -129,7 +129,7 @@ - + @@ -143,7 +143,7 @@ - + @@ -311,6 +311,7 @@ 添加 删除 + 批量新增
@@ -341,6 +342,22 @@ + + + + + + + + + + + + 保存 + 关闭 + + + @@ -874,6 +891,11 @@ fileFlag: false, fileContentList: [], IQCSelections: [], + batchHandleAddModalFlag: false, + batchAddData: { + samplingLocation: '', + samplingNumber: '' + } } }, mounted () { @@ -1242,16 +1264,16 @@ }) }, // 子明细方法 - //表格的新增 + // 表格的新增 rowClassName({ row, rowIndex }) { row.xh = rowIndex + 1; }, - //单选框选中数据 + // 单选框选中数据 handleDetailSelectionChange(selection) { this.checkedDetail = selection; }, - //点击新增更多 - handleAddBtn(td) { + // 点击新增更多 + handleAddBtn (td) { checkIQCIsSubmit(td).then(({data}) => { if (data.flag != 1) { let obj = {}; @@ -1265,6 +1287,36 @@ } }) }, + // 批量新增操作 + batchHandleAdd (td) { + checkIQCIsSubmit(td).then(({data}) => { + if (data.flag != 1) { + this.batchHandleAddModalFlag = true + } else { + this.$alert("记录已提交!", '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + // 批量新增行 + batchHandleAddModal () { + for (let i = 0; i < this.batchAddData.samplingNumber; i++) { + let obj = {} + obj.samplingLocation = this.batchAddData.samplingLocation + obj.subDetailValue = "" + this.tableData.push(obj) + } + this.batchHandleAddModalFlag = false + }, + // 回车事件 + nextFocus(index) { + console.log(index) + let aaa = `${index + 1}` + this.$nextTick(() => { + this.$refs[aaa].focus() + }) + }, //删除 handleDeleteBtn(td) { checkIQCIsSubmit(td).then(({data}) => { @@ -1289,7 +1341,7 @@ }); }); this.$message({ - message: "删除成功,记得保存修改喔!", + message: "删除成功!", type: "success", }); return;