From b26c948fe7ef2aa7f83fa063e035d8f5df0e4280 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 24 七月 2023 18:19:02 +0800
Subject: [PATCH] 主数据动态表头显示,主数据发布 停用
---
Source/UBCS-WEB/src/api/template/setPersonnel.js | 16 ++++
Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue | 164 +++++++++++++++++++++++++++-------------
Source/UBCS-WEB/src/page/index/index.vue | 1
Source/UBCS-WEB/src/components/Master/MasterTree.vue | 1
4 files changed, 126 insertions(+), 56 deletions(-)
diff --git a/Source/UBCS-WEB/src/api/template/setPersonnel.js b/Source/UBCS-WEB/src/api/template/setPersonnel.js
index 740945b..55aba0b 100644
--- a/Source/UBCS-WEB/src/api/template/setPersonnel.js
+++ b/Source/UBCS-WEB/src/api/template/setPersonnel.js
@@ -40,4 +40,20 @@
params: params
})
}
+// 鏌ヨ娴佺▼妯℃澘
+export const processTS = (params) => {
+ return request({
+ url: '/api/ubcs-flow/processTS/tlist',
+ method: 'get',
+ params: params
+ })
+}
+// 鏃犳祦绋嬫ā鏉挎墽琛屾搷浣�
+export const changeStatus = (params) => {
+ return request({
+ url: '/api/ubcs-code/mdmEngineController/changeStatus',
+ method: 'post',
+ data:params
+ })
+}
diff --git a/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue
index 0863be2..2262b41 100644
--- a/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue
+++ b/Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue
@@ -29,7 +29,9 @@
</div>
<el-row style="width: 100%;margin-bottom: 20px">
<div>
- <el-button v-for="(item, index) in masterVrBtnList" v-if="!['PREVIEW', 'DELETEFILE', 'revisefile', 'DOWNLOADFILE', 'UPLOADFILE'].includes(item.uniqueFlag)" :key="index" plain size="small"
+ <el-button v-for="(item, index) in masterVrBtnList"
+ v-if="!['PREVIEW', 'DELETEFILE', 'revisefile', 'DOWNLOADFILE', 'UPLOADFILE'].includes(item.uniqueFlag)"
+ :key="index" plain size="small"
type="primary"
@click="handelBtnClick(item)">{{
item.name
@@ -37,15 +39,15 @@
</el-button>
<el-input v-model="WupinFindValue" placeholder="璇疯緭鍏ュ叧閿瓧鎸夊洖杞︽煡璇�"
size="small" style="width: 180px; margin-left: 5px; margin-top: 10px"
- @keyup.enter.native="tableFindInp"></el-input>
+ @keyup.enter.native="tableFindInp" v-if="tableData.length != 0"></el-input>
</div>
- <el-table v-if="tableData.length != 0" ref="dataTable" v-loading="isLoading" :data="tableData"
+ <el-table ref="dataTable" v-loading="isLoading" :data="tableData"
:height="tableHeight"
@select="handleSelection" @cell-click="handleCellClick" @row-click="handleRowClick"
@select-all="handleSelectionAll" @selection-change="handleSelectionChange"
@sort-change="sortChange">
- <el-table-column fixed type="selection" width="55"></el-table-column>
- <el-table-column fixed label="搴忓彿" type="index" width="55">
+ <el-table-column fixed type="selection" width="55" v-if="tableData.length != 0"></el-table-column>
+ <el-table-column fixed label="搴忓彿" type="index" width="55" v-if="tableData.length != 0">
</el-table-column>
<el-table-column v-for="item in this.tableHeadFindData" :key="item.id" :formatter="item.formatter"
:label="item.label"
@@ -114,6 +116,7 @@
</template>
<script>
import {MasterTable, TableData, FindData, addSaveCode, editSaveCode} from "@/api/GetItem";
+import {processTS,changeStatus} from "@/api/template/setPersonnel"
import {listCodeAttributeByClassId} from "@/api/integration/integration.js";
import integrationTransfer from "@/views/integration/integrationTransfer";
import SetPersonnel from "@/components/template/SetPersonnel";
@@ -173,7 +176,7 @@
},
data() {
return {
- searchResults:[],
+ searchResults: [],
//棣栭〉鍙充晶鎼滅储
WupinFindValue: "",
//鐩镐技椤规煡璇�
@@ -278,7 +281,7 @@
tableDataArray: {
handler(newval, oldval) {
this.tableData = newval;
- this.searchResults=newval
+ this.searchResults = newval
},
},
tableHeadFindData: {
@@ -299,6 +302,8 @@
}
})
this.tableHeadFindDatas = newval;
+ console.log('newval',newval)
+ console.log('newval',this.tableHeadFindData)
},
},
total: {
@@ -384,46 +389,104 @@
},
// 鍙戝竷
setHandler() {
- // let EditFlag1=false
- // let EditFlag2=false
- // if(EditFlag1){
- // this.$message.warning('鍙湁鐘舵�佹槸銆愮紪杈戜腑銆戠殑鏁版嵁鎵嶅彲浠ュ彂璧锋祦绋�')
- // }else if(EditFlag2){
- // this.$message.warning('鎮ㄩ�夋嫨鐨勬暟鎹叏閮ㄤ负銆愮紪杈戜腑銆戞墠鍙互鍙戣捣娴佺▼')
- // }
- this.selectRow.forEach(item => {
- if (this.selectRow.length === 1 && item.lcstatus !== "Editing") {
- this.$message.warning('鍙湁鐘舵�佹槸銆愮紪杈戜腑銆戠殑鏁版嵁鎵嶅彲浠ュ彂璧锋祦绋�')
- } else if (item.lcstatus !== 'Editing') {
- this.$message.warning('鎮ㄩ�夋嫨鐨勬暟鎹叏閮ㄤ负銆愮紪杈戜腑銆戞墠鍙互鍙戣捣娴佺▼')
- } else {
- this.userName = localStorage.getItem("username");
- this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]";
- this.parameter.type = 'PUBLIC'
- this.title = '娴佺▼瀹℃壒'
- this.visibleFlow = true;
- }
- })
- // if (this.selectRow.length <= 0) {
- // this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�");
- // } else {
- // this.userName = localStorage.getItem("username");
- // this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]";
- // this.parameter.type='PUBLIC'
- // this.title='娴佺▼瀹℃壒'
- // this.visibleFlow = true;
- // }
+ if (this.selectRow.length > 0) {
+ let hasEditing = this.selectRow.some(item => item.lcstatus !== 'Editing');
+ let showMessage = true;
+ this.selectRow.forEach(item => {
+ if (this.selectRow.length === 1 && item.lcstatus !== "Editing" && showMessage) {
+ this.$message.warning('鍙湁鐘舵�佹槸銆愮紪杈戜腑銆戠殑鏁版嵁鎵嶅彲浠ュ彂璧锋祦绋�');
+ showMessage = false;
+ } else if (hasEditing && showMessage) {
+ this.$message.warning('鎮ㄩ�夋嫨鐨勬暟鎹叏閮ㄤ负銆愮紪杈戜腑銆戞墠鍙互鍙戣捣娴佺▼');
+ showMessage = false;
+ } else if (showMessage) {
+ processTS({templateId: this.templateOid, buttonTypeKey: 'PUBLIC'}).then(res => {
+ if (res.data.records != [] && res.data.code != 200) {
+ this.userName = localStorage.getItem("username");
+ this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]";
+ this.parameter.type = 'PUBLIC'
+ this.title = '娴佺▼瀹℃壒'
+ this.visibleFlow = true;
+ this.onLoad()
+ } else {
+ this.$confirm('褰撳墠鍒嗙被娌℃湁娣诲姞娴佺▼妯℃澘锛屾槸鍚︿笉鐢ㄦ祦绋嬪鎵圭洿鎺ユ墽琛�?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ this.userName = localStorage.getItem("username");
+ this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]";
+ this.parameter.type = 'PUBLIC'
+ this.title = '娴佺▼瀹℃壒'
+ this.visibleFlow = true;
+ this.onLoad()
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑�'
+ });
+ })
+ }
+ })
+ }
+ });
+ } else {
+ this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�')
+ }
},
//鍋滅敤
Deactivate() {
if (this.selectRow.length <= 0) {
this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�");
} else {
- this.userName = localStorage.getItem("username");
- this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]";
- this.parameter.type = 'DISABLE'
- this.title = '鍋滅敤锛堝喕缁擄級缂栫爜鏁版嵁'
- this.visibleDeactivate = true;
+ let hasEditing = this.selectRow.some(item => item.lcstatus == 'Released');
+ let showMessage = true;
+ this.selectRow.forEach(item => {
+ if (this.selectRow.length === 1 && item.lcstatus === "Disabled" && showMessage) {
+ this.$message.warning('閫夋嫨鐨勬暟鎹腑鐘舵�佹棤闇�鍐嶆墽琛屽綋鍓嶆搷浣�');
+ showMessage = false;
+ } else if (this.selectRow.length >1 && !hasEditing && showMessage) {
+ this.$message.warning('鎮ㄩ�夋嫨鐨勬暟鎹叏閮ㄤ负銆愬彂甯冪姸鎬併�戞墠鍙互鍙戣捣娴佺▼');
+ 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) {
+ this.userName = localStorage.getItem("username");
+ this.parameter.template = this.userName + "鍋滅敤" + "[鐗╁搧]";
+ this.parameter.type = 'DISABLE'
+ this.title = '鍋滅敤锛堝喕缁擄級缂栫爜鏁版嵁'
+ this.visibleDeactivate = true;
+ } else {
+ if (showMessage) {
+ showMessage = false; // 鏍囪宸叉墽琛岃繃鎿嶄綔
+ this.$confirm('褰撳墠鍒嗙被娌℃湁娣诲姞娴佺▼妯℃澘锛屾槸鍚︿笉鐢ㄦ祦绋嬪鎵圭洿鎺ユ墽琛�?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ const index = this.$route.query.id.indexOf('@');
+ 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()
+ }
+ });
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑�'
+ });
+ });
+ }
+ }
+ });
+ }else {
+ this.$message.warning('鎮ㄩ�夋嫨鐨勬暟鎹负銆愬彂甯冪姸鎬併�戞墠鍙互鍙戣捣娴佺▼')
+ }
+ });
}
},
//鍚敤
@@ -431,11 +494,7 @@
if (this.selectRow.length <= 0) {
this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�");
} else {
- this.userName = localStorage.getItem("username");
- this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]";
- this.parameter.type = 'ENABLE'
- this.title = '鍚敤锛堣В鍐伙級缂栫爜鏁版嵁'
- this.visibleEnable = true;
+
}
},
//鍥炴敹
@@ -443,11 +502,7 @@
if (this.selectRow.length <= 0) {
this.$message.warning("璇烽�夋嫨涓�鏉℃暟鎹�");
} else {
- this.userName = localStorage.getItem("username");
- this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]";
- this.parameter.type = 'ROLLBACK'
- this.title = '鍥炴敹缂栫爜鏁版嵁'
- this.visibleRecovery = true;
+
}
},
handleSizeChange(val) {
@@ -569,7 +624,7 @@
list.forEach((item) => {
this.parameter.ids.push(item.oid);
});
- console.log(this.parameter)
+ console.log(this.selectRow)
},
//閫夋嫨
handleSelection(list, row) {
@@ -581,7 +636,6 @@
handleSelectionAll() {
this.fileOptions.ownbizOid = '0';
this.fileOptions.ownbizBtm = '0';
-
},
//缂栬緫
editHandler() {
@@ -666,10 +720,10 @@
this.$message.warning('杈撳叆鍊间笉鑳戒负绌�')
return;
}
- this.tableData = this.searchResults.filter(item => {
+ this.tableData = this.searchResults.filter(item => {
if (typeof item.name === 'string') {
return item.name.includes(this.WupinFindValue);
- }else {
+ } else {
return false; // item.name涓嶆槸瀛楃涓茬被鍨嬶紝杩斿洖false
}
});
diff --git a/Source/UBCS-WEB/src/components/Master/MasterTree.vue b/Source/UBCS-WEB/src/components/Master/MasterTree.vue
index ce76a42..12158d7 100644
--- a/Source/UBCS-WEB/src/components/Master/MasterTree.vue
+++ b/Source/UBCS-WEB/src/components/Master/MasterTree.vue
@@ -151,6 +151,7 @@
this.$emit('tableHeadDataFateher', this.tableHeadDataFateher);
this.$emit('tableHeadFindData', this.tableHeadFindData);
this.$emit('tableHeadBttoms', this.masterVrBtnList);
+ console.log( 'head',this.tableHeadFindData)
resolve();
}).catch(err => {
reject(err)
diff --git a/Source/UBCS-WEB/src/page/index/index.vue b/Source/UBCS-WEB/src/page/index/index.vue
index 6f70b9a..0ee7d19 100644
--- a/Source/UBCS-WEB/src/page/index/index.vue
+++ b/Source/UBCS-WEB/src/page/index/index.vue
@@ -98,7 +98,6 @@
openMenu(item = {}) {
this.$store.dispatch("GetMenu", item.id).then(data => {
if (data.length !== 0) {
- debugger;
this.$router.$avueRouter.formatRoutes(data, true);
}
//褰撶偣鍑婚《閮ㄨ彍鍗曞悗榛樿鎵撳紑绗竴涓彍鍗�
--
Gitblit v1.9.3