From 735916a9ac00b8ef1a1e0a548e7804a3ffef396a Mon Sep 17 00:00:00 2001 From: wente <329538422@qq.com> Date: 星期五, 12 一月 2024 10:39:45 +0800 Subject: [PATCH] 项目表 --- web/src/views/modules/project/SoftwareTestOrder-AddOrUpdate.vue | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 43 insertions(+), 4 deletions(-) diff --git a/web/src/views/modules/project/SoftwareTestOrder-AddOrUpdate.vue b/web/src/views/modules/project/SoftwareTestOrder-AddOrUpdate.vue index 2c277af..ca05f56 100644 --- a/web/src/views/modules/project/SoftwareTestOrder-AddOrUpdate.vue +++ b/web/src/views/modules/project/SoftwareTestOrder-AddOrUpdate.vue @@ -86,8 +86,8 @@ <div style="width:88px !important;" class="DWidth DAlign DHold"> 琚祴浠跺強鍏朵粬鐩稿叧鐗╁搧娓呭崟 </div> - <div style="width: calc(100% - 120px);padding: 5px"> - <el-table class="el-software" height="230" border :data="dataForm.measuredList" + <div class="table-container" style="width: calc(100% - 120px);padding: 5px"> + <el-table ref="tableMeasuredList" class="el-software" border :data="dataForm.measuredList" @cell-click="handleCellClick" stripe> <el-table-column prop="no" align="center" width="80" label="搴忓彿"/> @@ -105,8 +105,18 @@ <zt-dict v-model="scope.row.isMeasured" dict="is_or_not" :radio="true"></zt-dict> </template> </el-table-column> + <el-table-column fixed="right" label="鎿嶄綔" align="center"> + <template slot-scope="scope"> + <zt-table-button @click="deleteMeasuredRow(scope.$index)">鍒犻櫎</zt-table-button> + </template> + </el-table-column> </el-table> + <div v-if="!dataForm.disabled" class="icon-container" @click="addMeasuredRow()"> + <!-- 鏀剧疆鍥哄畾鐨勫浘鏍� --> + <i class="el-icon-plus"></i> + </div> </div> + </div> <div class="el-flex" style="height: 40px;"> <div class="DWidth DAlign DHold"> @@ -318,13 +328,22 @@ <div style="width:88px !important;" class="DWidth DAlign DHold"> 浜や粯鐗╂竻鍗� </div> - <div style="width: calc(100% - 120px);padding: 5px"> - <el-table class="el-software" height="100" border :data="dataForm.deliverableList" + <div class="table-container" style="width: calc(100% - 120px);padding: 5px"> + <el-table ref="tableDeliverableList" class="el-software" border :data="dataForm.deliverableList" stripe> <el-table-column type="index" align="center" width="80" label="搴忓彿"/> <el-table-column prop="name" min-width="300" label="鍚嶇О"></el-table-column> <el-table-column prop="identify" align="center" width="380" label="鏍囪瘑/鐗堟湰"></el-table-column> + <el-table-column fixed="right" label="鎿嶄綔" align="center"> + <template slot-scope="scope"> + <zt-table-button @click="deleteDeliverableRow(scope.$index)">鍒犻櫎</zt-table-button> + </template> + </el-table-column> </el-table> + <div v-if="!dataForm.disabled" class="icon-container" @click="addDeliverableRow()"> + <!-- 鏀剧疆鍥哄畾鐨勫浘鏍� --> + <i class="el-icon-plus"></i> + </div> </div> </div> </div> @@ -567,6 +586,26 @@ // console.log(this.dataForm, "this.dataForm") console.log(this.dataForm,"getInfo this.dataForm") }, + addDeliverableRow() { + this.dataForm.deliverableList.push({}) + this.$nextTick(() => { + const tableBody = this.$refs.tableDeliverableList.$el.querySelector('.el-table__body-wrapper') + tableBody.scrollTop = tableBody.scrollHeight + }) + }, + deleteDeliverableRow(index){ + this.dataForm.deliverableList.splice(index, 1) + }, + addMeasuredRow() { + this.dataForm.measuredList.push({}) + this.$nextTick(() => { + const tableBody = this.$refs.tableMeasuredList.$el.querySelector('.el-table__body-wrapper') + tableBody.scrollTop = tableBody.scrollHeight + }) + }, + deleteMeasuredRow(index){ + this.dataForm.measuredList.splice(index, 1) + }, async print(){ var params = qs.stringify({ token: Cookies.get('token'), -- Gitblit v1.9.1