From 89428d6f5f78ef9f0a3dcb7f51d1aaea11d556fa Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 02 八月 2023 10:46:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue | 61 +++++++++++++++++++-----------
1 files changed, 39 insertions(+), 22 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
index 2fbc819..1bec8e9 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,11 @@
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.template = this.userName + "-鍙戝竷" + "[鐗╁搧]";
- this.parameter.type = 'PUBLIC'
+ this.parameter.type = 'PUBLIC';
+ this.parameter.code=this.templateOid
this.title = '娴佺▼瀹℃壒'
this.visibleFlow = true;
this.onLoad()
@@ -431,10 +434,11 @@
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.records != [] && res.data.data.records.length!=0) {
this.userName = localStorage.getItem("username");
this.parameter.template = this.userName + "鍋滅敤" + "[鐗╁搧]";
- this.parameter.type = 'DISABLE'
+ this.parameter.type = 'DISABLE';
+ this.parameter.code=this.templateOid
this.title = '鍋滅敤锛堝喕缁擄級缂栫爜鏁版嵁'
this.visibleDeactivate = true;
} else {
@@ -449,7 +453,6 @@
const result = this.$route.query.id.substring(0, index);
const oid = this.selectRow.map(obj => obj.oid).join(",");
changeStatus({ oid: oid, btmname: result, lcStatus: 'Disabled' }).then(res => {
- console.log(res);
if(res.data.code == 200 ){
this.$message.success('鍋滅敤鎴愬姛')
this.onLoad()
@@ -476,7 +479,6 @@
this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�");
} else {
let hasEditing = this.selectRow.every(item => item.lcstatus == 'Disabled');
- console.log('hasEditing',hasEditing)
let showMessage = true;
this.selectRow.forEach(item => {
if (this.selectRow.length === 1 && item.lcstatus !== "Disabled" && showMessage) {
@@ -484,10 +486,12 @@
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'
+ this.parameter.type = 'Released';
+ this.parameter.code=this.templateOid
this.title = '鍚敤缂栫爜鏁版嵁'
this.visibleDeactivate = true;
} else {
@@ -502,7 +506,6 @@
const result = this.$route.query.id.substring(0, index);
const oid = this.selectRow.map(obj => obj.oid).join(",");
changeStatus({ oid: oid, btmname: result, lcStatus: 'Released' }).then(res => {
- console.log(res);
if(res.data.code == 200 ){
this.$message.success('鍚敤鎴愬姛')
this.onLoad()
@@ -535,7 +538,6 @@
// 鍋滅敤-鍙兘鍚敤銆佸洖鏀�
const disabledCount = this.selectRow.filter(item => item.lcstatus === 'Disabled').length;
const releasedCount = this.selectRow.filter(item => item.lcstatus === 'Released').length;
- console.log('hasEditing',disabledCount,releasedCount)
let showMessage = true;
this.selectRow.forEach(item => {
if (this.selectRow.length === 1 && item.lcstatus == "TakeBack" && showMessage) {
@@ -544,10 +546,11 @@
} 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.records != [] && res.data.data.records.length!=0) {
this.userName = localStorage.getItem("username");
this.parameter.template = this.userName + "鍥炴敹" + "[鐗╁搧]";
- this.parameter.type = 'TakeBack'
+ this.parameter.type = 'TakeBack';
+ this.parameter.code=this.templateOid
this.title = '鍥炴敹缂栫爜鏁版嵁'
this.visibleDeactivate = true;
} else {
@@ -562,7 +565,6 @@
const result = this.$route.query.id.substring(0, index);
const oid = this.selectRow.map(obj => obj.oid).join(",");
changeStatus({ oid: oid, btmname: result, lcStatus: 'TakeBack' }).then(res => {
- console.log(res);
if(res.data.code == 200 ){
this.$message.success('鍥炴敹鎴愬姛')
this.onLoad()
@@ -613,7 +615,29 @@
},
//鍒犻櫎
enumDeleteRow(row) {
- this.tableData.splice(row, 1);
+ this.$confirm('鏄惁鍒犻櫎閫変腑鏁版嵁?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ const list=[];
+ this.selectRow.forEach((item)=>{list.push(item.oid)})
+ 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() {
@@ -621,7 +645,6 @@
},
doLayout() {
this.$nextTick(() => {
- console.log(this.$refs)
this.$refs.crud.doLayout();
});
},
@@ -703,7 +726,6 @@
list.forEach((item) => {
this.parameter.ids.push(item.oid);
});
- console.log(this.selectRow)
},
//閫夋嫨
handleSelection(list, row) {
@@ -740,7 +762,6 @@
codeClassifyOid: this.codeClassifyOid,
...val,
}).then((res) => {
- console.log(res);
this.tableData = res.data.data;
this.page.total = res.data.total
});
@@ -770,9 +791,7 @@
//澧炲姞淇濆瓨
AddSumbit(val) {
this.addvisible = false;
- console.log(val)
addSaveCode(val).then(res => {
- console.log(res)
this.$nextTick(() => {
this.onLoad()
})
@@ -780,9 +799,7 @@
},
EditSumbit(val) {
this.editvisible = false;
- console.log(val)
editSaveCode(val).then(res => {
- console.log(res)
this.$nextTick(() => {
this.onLoad()
})
--
Gitblit v1.10.0