From 7db11f1ecbe7df37eb1a8adfdfadc8b654d46522 Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期三, 09 四月 2025 17:30:31 +0800 Subject: [PATCH] 2 --- src/views/picture/picture/index.vue | 96 +++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 87 insertions(+), 9 deletions(-) diff --git a/src/views/picture/picture/index.vue b/src/views/picture/picture/index.vue index 9219872..d49b142 100644 --- a/src/views/picture/picture/index.vue +++ b/src/views/picture/picture/index.vue @@ -242,7 +242,7 @@ prop="bcupdateTime" min-width="160" /> - <el-table-column label="鎿嶄綔" align="center" min-width="120px"> + <!-- <el-table-column label="鎿嶄綔" align="center" min-width="120px"> <template slot-scope="scope"> <el-button size="mini" @@ -262,9 +262,8 @@ @click="queryResultone(scope.row)" >缁撴灉</el-button > - <!-- @click="chaxun(scope.row) " --> </template> - </el-table-column> + </el-table-column> --> <!-- <el-table-column type="selection" width="40" align="center" /> <el-table-column label="鏀惰垂椤圭洰" align="center" prop="proName" /> @@ -280,7 +279,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 +339,15 @@ /> </div> - <Public ref="aaa" @add="handleChanges" /> + <Public + ref="aaa" + :check-status="checkStatus" + :pro-result="form.proResult" + :conclusion="form.conclusion" + @add="handleChanges" + :project-list="projectList" + /> + <!-- :last-desc="form.conclusion" --> </div> </template> @@ -407,6 +419,7 @@ pictureList: [], tableList: [], CompanyList: [], + projectList: [], // 寮瑰嚭灞傛爣棰� title: "", // 鏄惁鏄剧ず寮瑰嚭灞� @@ -640,6 +653,7 @@ this.loading = false; }); */ }, + // 鍙栨秷鎸夐挳 cancel() { this.open = false; @@ -750,6 +764,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 +828,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 +855,64 @@ } 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) { + this.projectList = selection.map((item) => ({ + proId: item.proId, + proName: item.proName, + })); + 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,15 +924,17 @@ this.form.conclusion = res.data.jcjl; }); } - }, + }, */ - handleChanges(value) { + handleChanges(value, yxbx) { this.form.conclusion = value; + this.form.proResult = yxbx; }, submiepilog() { this.$refs.aaa.open = true; let proId = "1633660948860522585"; + // let proId = null this.$refs.aaa.getList(proId); }, tupian() { -- Gitblit v1.8.0