From 8b29c5daf0cde34304208adeb07fdccae36ae58d Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 01 八月 2023 21:20:22 +0800 Subject: [PATCH] 代码整合 --- Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue | 44 +++++++++++++++++++++++++++++++++++++------- 1 files changed, 37 insertions(+), 7 deletions(-) diff --git a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue index 33e8bfe..3e16597 100644 --- a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue +++ b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue @@ -95,7 +95,7 @@ </basic-container> </template> <script> -import {MasterTable, TableData, FindData, addSaveCode, editSaveCode} from "@/api/GetItem"; +import {MasterTable, TableData, FindData, addSaveCode, editSaveCode,deleteCode} from "@/api/GetItem"; import {processTS,changeStatus} from "@/api/template/setPersonnel" import {listCodeAttributeByClassId} from "@/api/integration/integration.js"; import integrationTransfer from "@/views/integration/integrationTransfer"; @@ -344,6 +344,8 @@ if (uniqueFlag === 'CODEENABLE') return this.Enable() //鍥炴敹 if (uniqueFlag === 'CODERECYCLE') return this.Recovery() + //鍒犻櫎 + if (uniqueFlag === 'CODEDELETE') return this.enumDeleteRow() // 鐩镐技椤规煡璇� // if(uniqueFlag === 'CODEEDIT') return this.similarHandler() }); @@ -382,10 +384,12 @@ showMessage = false; } else if (showMessage) { processTS({templateId: this.templateOid, buttonTypeKey: 'PUBLIC'}).then(res => { - if (res.data.records != [] && res.data.code != 200) { + if (res.data.data.records && res.data.data.records.length!=0) { this.userName = localStorage.getItem("username"); + this.parameter=res.data.data.records[0] this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]"; - this.parameter.type = 'PUBLIC' + this.parameter.type = 'PUBLIC'; + this.parameter.code=this.templateOid this.title = '娴佺▼瀹℃壒' this.visibleFlow = true; this.onLoad() @@ -431,7 +435,8 @@ showMessage = false; } else if (this.selectRow.length > 1 && hasEditing && showMessage) { processTS({ templateId: this.templateOid, buttonTypeKey: 'PUBLIC' }).then(res => { - if (res.data.records != [] && res.data.code != 200) { + if (res.data.data.records && res.data.data.records.length!=0) { + this.parameter=res.data.data.records[0] this.userName = localStorage.getItem("username"); this.parameter.template = this.userName + "鍋滅敤" + "[鐗╁搧]"; this.parameter.type = 'DISABLE' @@ -482,7 +487,8 @@ showMessage = false; } else if (this.selectRow.length >=1 && hasEditing && showMessage) { processTS({ templateId: this.templateOid, buttonTypeKey: 'PUBLIC' }).then(res => { - if (res.data.records != [] && res.data.code != 200) { + if (res.data.data.records && res.data.data.records.length!=0) { + this.parameter=res.data.data.records[0] this.userName = localStorage.getItem("username"); this.parameter.template = this.userName + "鍚敤" + "[鐗╁搧]"; this.parameter.type = 'Released' @@ -540,7 +546,8 @@ } else if (this.selectRow.length >=1 && (disabledCount === this.selectRow.length || releasedCount === this.selectRow.length) || (disabledCount > 0 && releasedCount > 0) && showMessage) { //disabledCount 鍜� releasedCount 涓换鎰忎竴涓瓑浜� this.selectRow 鏁扮粍鐨勯暱搴﹀垯琛ㄧず鍏ㄩ儴鏄悓涓�绉嶇姸鎬侊紝杩斿洖 true 濡傛灉disabledCount 鍜� releasedCount 閮藉ぇ浜�0锛屽垯琛ㄧず鏃㈡湁Disabled涔熸湁Released杩斿洖 true processTS({ templateId: this.templateOid, buttonTypeKey: 'PUBLIC' }).then(res => { - if (res.data.records != [] && res.data.code != 200) { + if (res.data.data.records && res.data.data.records.length!=0) { + this.parameter=res.data.data.records[0] this.userName = localStorage.getItem("username"); this.parameter.template = this.userName + "鍥炴敹" + "[鐗╁搧]"; this.parameter.type = 'TakeBack' @@ -608,7 +615,30 @@ }, //鍒犻櫎 enumDeleteRow(row) { - this.tableData.splice(row, 1); + this.$confirm('鏄惁鍒犻櫎閫変腑鏁版嵁?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + const list=[]; + this.selectRow.forEach((item)=>{list.push(item.oid)}) + console.log(list) + deleteCode({codeClassifyOid:this.codeClassifyOid,oidList:list}).then(res=>{ + console.log(res) + if(res.data.code === 200){ + this.$message({ + type: 'success', + message: '鍒犻櫎鎴愬姛!' + }); + } + this.onLoad() + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }); }, // 灏嗘鍦ㄧ紪杈戠殑琛岀殑鐘舵�佸彉涓� null 锛屽嵆閫�鍑虹紪杈戠姸鎬� saveRow() { -- Gitblit v1.9.3