From 2f0e1ee5a74344f6a108df4559beed0423b9639d Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期二, 08 四月 2025 17:50:19 +0800 Subject: [PATCH] 1 --- src/views/picture/picture/index.vue | 79 +++++++++++++++++++++++++++++++++++---- 1 files changed, 71 insertions(+), 8 deletions(-) diff --git a/src/views/picture/picture/index.vue b/src/views/picture/picture/index.vue index 91c4462..e24dc28 100644 --- a/src/views/picture/picture/index.vue +++ b/src/views/picture/picture/index.vue @@ -280,7 +280,12 @@ label-width="68px" > <el-form-item label="妫�鏌ユ墍瑙�" prop="proResult"> - <el-input v-model="form.proResult" clearable type="textarea" /> + <el-input + v-model="form.proResult" + clearable + type="textarea" + @focus="submiepilog" + /> </el-form-item> <el-form-item label="妫�鏌ョ粨璁�" prop="conclusion"> <el-input @@ -335,7 +340,8 @@ /> </div> - <Public ref="aaa" :last-desc="form.conclusion" @add="handleChanges" /> + <Public ref="aaa" :check-status="checkStatus" :pro-result="form.proResult" :conclusion="form.conclusion" @add="handleChanges" /> + <!-- :last-desc="form.conclusion" --> </div> </template> @@ -750,6 +756,13 @@ console.log(res, 222); this.tableList = res.data; this.loading = false; + this.$nextTick(() => { + if (this.tableList.length > 0) { + const firstRow = this.tableList[0]; + this.$refs.mu.toggleRowSelection(firstRow, true); + this.handleChange([firstRow]); + } + }); }); }, @@ -807,7 +820,7 @@ }, // 澶氶�夋閫変腑鏁版嵁 - handleSelectionChange(selection) { + /* handleSelectionChange(selection) { this.imgsrc = selection[0].picturePath; this.tjNumber = selection[0].customer.tjNumber; this.ids = selection.map((item) => item.id); @@ -834,9 +847,60 @@ } this.single = selection.length !== 1; this.multiple = !selection.length; + }, */ + handleSelectionChange(selection) { + this.imgsrc = selection[0].picturePath; + this.tjNumber = selection[0].customer.tjNumber; + this.ids = selection.map((item) => item.id); + + if (selection.length > 1) { + let del_row = selection.shift(); + this.$refs.tb.toggleRowSelection(del_row, false); + } + + this.single = selection.length !== 1; + this.multiple = !selection.length; + + selection.forEach((element) => { + this.tableList = element.list; + + if (this.tableList.length !== 0) { + // 鉁� 鎻愬墠璧嬪�� selectedRow锛岄伩鍏� handleChange 鏃舵湭璧嬪�� + this.selectedRow = this.tableList[0]; + this.form.proResult = this.tableList[0].proResult; + this.form.conclusion = this.tableList[0].conclusion; + + this.$nextTick(() => { + this.$refs.mu.toggleRowSelection(this.tableList[0], true); + }); + } else { + this.selectedRow = null; + this.$refs.mu.clearSelection(); + } + }); + }, + handleChange(selection) { + if (selection && selection.length > 0) { + const proId = selection[0].proId; + + // 鉁� 纭繚 selectedRow 瀛樺湪涓旀湁 tjNumber + if (this.selectedRow && this.selectedRow.tjNumber) { + const tjNumber = this.selectedRow.tjNumber; + getYxJcXxJg(tjNumber, proId).then((res) => { + this.form.proResult = res.data.jcsj; + this.form.conclusion = res.data.jcjl; + this.$refs.aaa.updateData(res.data.jcsj, res.data.jcjl); + }); + } else { + console.warn("selectedRow 鏈噯澶囧ソ锛岃烦杩囨帴鍙h皟鐢�"); + } + + // 鉁� 鍚屾椂鏇存柊 selectedRow + this.selectedRow = selection[0]; + } }, - handleChange(selection) { + /* handleChange(selection) { // console.log(selection, 123); if (selection && selection.length > 0) { const proId = selection[0].proId; @@ -848,9 +912,9 @@ this.form.conclusion = res.data.jcjl; }); } - }, + }, */ - handleChanges(value,yxbx) { + handleChanges(value, yxbx) { this.form.conclusion = value; this.form.proResult = yxbx; }, @@ -858,9 +922,8 @@ submiepilog() { this.$refs.aaa.open = true; let proId = "1633660948860522585"; - // let proId = null + // let proId = null this.$refs.aaa.getList(proId); - }, tupian() { this.dialogVisible = true; -- Gitblit v1.8.0