From 6160ef98b644415cf8362b63f1ac72df113d4860 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 24 七月 2023 20:33:28 +0800
Subject: [PATCH] 前端代码打包

---
 Source/UBCS-WEB/src/components/Crud/VciMasterCrud.vue |  164 ++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 109 insertions(+), 55 deletions(-)

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
         }
       });

--
Gitblit v1.9.3