From 09a37b6f677680680bca3382e9e04cf8cdffbda7 Mon Sep 17 00:00:00 2001 From: pengjun <158915633@qq.com> Date: Wed, 8 Nov 2023 16:23:12 +0800 Subject: [PATCH] sample --- src/views/common-settings/SampleGroup.vue | 68 ++++-- src/views/fee-settings/PayMode.vue | 266 +++++++++++----------- 2 files changed, 183 insertions(+), 151 deletions(-) diff --git a/src/views/common-settings/SampleGroup.vue b/src/views/common-settings/SampleGroup.vue index 156ff9a..2834f8d 100644 --- a/src/views/common-settings/SampleGroup.vue +++ b/src/views/common-settings/SampleGroup.vue @@ -10,7 +10,7 @@ height="240px" class="el-table__body-wrapper tbody" border:stripe="true" - @row-click="rowick" + @row-click="rowick" ref="info" highlight-current-row > @@ -149,27 +149,27 @@ - + - + + placeholder="请选择" size="small"> - + - + - + + + - + { - this.$message.success("新增成功"); - this.getlist(); - this.dialogVisible = false; + if(res.code != -1){ + this.$message.success("新增成功"); + // this.getlist(); 改为局部刷新 + this.form.id = res.data.id + this.tableData.push(deepCopy(res.data)) + this.dialogVisible = false; + } }); } else if (this.title == 2) { barcodeediting(this.form.id, { @@ -885,14 +890,39 @@ export default { sampleTypeId: this.form.sampleTypeId, sampleContainerId: this.form.sampleContainerId, }).then((res) => { - this.$message.success("修改成功"); - this.dialogVisible = false; - this.getlist(); + if(res.code != -1){ + this.$message.success("修改成功"); + // this.getlist(); 改为局部刷新 + this.dialogVisible = false; + } }); } } }); }, + + closeDialog(){ + if(!this.form.id) return + + let currentRow = {} + let lfind = arrayExistObj(this.tableData,'id',this.form.id) + if(lfind > -1){ + objCopy(this.form,this.tableData[lfind]) + currentRow = this.tableData[lfind] + }else{ + currentRow = deepCopy(this.form) + lfind = this.tableData.length + this.tableData.push(currentRow) + } + + if(lfind > -1){ + this.$nextTick(()=>{ + this.$refs['info'].setCurrentRow(currentRow) + this.rowick(currentRow) + }) + } + }, + //新增弹框 btnAdd() { this.dialogVisible = true; diff --git a/src/views/fee-settings/PayMode.vue b/src/views/fee-settings/PayMode.vue index e7e071a..5c48882 100644 --- a/src/views/fee-settings/PayMode.vue +++ b/src/views/fee-settings/PayMode.vue @@ -1,109 +1,120 @@