From 42c17fe468ceea7e5eed7fec520b9858bed02e85 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 04 八月 2023 17:52:30 +0800
Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs

---
 Source/UBCS-WEB/src/components/Master/MasterTransfer.vue |  109 +++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 71 insertions(+), 38 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue
index 14a58c6..24ea436 100644
--- a/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue
+++ b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue
@@ -57,6 +57,7 @@
         data: []
       },
       exportArr:{},
+      exportArrTwo:{},
       ids:""
     };
   },
@@ -68,7 +69,6 @@
     //琛ㄥご鏁版嵁 鐢ㄦ潵娓叉煋绌挎妗�
     tableHeadData: {
       handler(newval, oldval) {
-        console.log(newval)
         if (newval) {
           // 娓呯┖data鏁扮粍
           this.data = [];
@@ -80,7 +80,6 @@
               key: index,
             });
           });
-          console.log(this.data)
           // excel琛ㄦ牸鏁版嵁杞崲
           this.option.column[0].children = newval.map(obj => {
             return {
@@ -107,6 +106,11 @@
     codeClassifyOid:{
       handler(newval,oldval){
       }
+    },
+    value:{
+      handler(newval,oldval){
+        console.log('value',newval)
+      }
     }
   },
   computed:{
@@ -125,16 +129,54 @@
       this.$emit('update:visible', false);
     },
     handleExcel(){
-      if(this.value <= 0){
-        this.$message.warning('璇烽�夋嫨灞炴��')
-      }else {
         this.value.map(index => this.tableHeadData[index].prop).forEach((item, index) => {
           this.exportArr[`attrIdIndexMap[${index}]`] = item
         })
         if(this.radio === 0){
           if(this.selectRow.length<=0){
-            this.ids=this.tableData.map(item => item.oid).join(',')
-            exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{
+            this.$message.warning('璇烽�夋嫨瑕佸鍑虹殑妯℃澘')
+          }else {
+            //宸查�夋嫨澶氶��
+            const selectList=[]
+            //宸查�夋嫨灞炴��
+            let exportArr={}
+            this.ids = this.selectRow.map(item => item.oid).join(',')
+            this.selectRow.forEach(item=>{
+              selectList.push(
+                item.oid
+              )
+            })
+            if(this.value <= 0){
+              this.tableHeadData.map(item => item.prop)
+                .forEach((prop, index) => {
+                  this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop;
+                });
+              exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArrTwo,limit:-1}).then(res=>{
+                // console.log('res',res)
+                if(res){
+                  func.downloadFileByBlobHandler(res);
+                  this.escHandler()
+                }
+              })
+            }else {
+
+              exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArr}).then(res=>{
+                // console.log('res',res)
+                if(res){
+                  func.downloadFileByBlobHandler(res);
+                  this.escHandler()
+                }
+              })
+
+            }
+            }
+        }else if(this.radio === 1){
+          if(this.value <= 0){
+            this.tableHeadData.map(item => item.prop)
+              .forEach((prop, index) => {
+                this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop;
+              });
+            exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArrTwo,limit:-1}).then(res=>{
               // console.log('res',res)
               if(res){
                 func.downloadFileByBlobHandler(res);
@@ -142,34 +184,14 @@
               }
             })
           }else {
-            //宸查�夋嫨澶氶��
-            const selectList=[]
-            //宸查�夋嫨灞炴��
-            let exportArr={}
-            const ids = this.selectRow.map(item => item.oid).join(',')
-            this.selectRow.forEach(item=>{
-              selectList.push(
-                item.oid
-              )
-            })
-            exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':this.ids,...this.exportArr}).then(res=>{
+            exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{
               // console.log('res',res)
               if(res){
                 func.downloadFileByBlobHandler(res);
                 this.escHandler()
               }
             })
-
           }
-        }else if(this.radio === 1){
-          this.ids=this.tableData.map(item => item.oid).join(',')
-          exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArr,limit:-1}).then(res=>{
-            // console.log('res',res)
-            if(res){
-              func.downloadFileByBlobHandler(res);
-              this.escHandler()
-            }
-          })
         }else if(this.radio === 2){
           const input = this.pageExport.trim();
           let start, end;
@@ -195,17 +217,28 @@
               return;
             }
           }
-          exportCode({ codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: this.limit, page: start, endPage: end }).then((res) => {
-            // console.log('res',res)
-            if (res) {
-              func.downloadFileByBlobHandler(res);
-              this.escHandler()
-            }
-          });
+          if(this.value >=1 ){
+            exportCode({ codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: this.limit, page: start, endPage: end }).then((res) => {
+              // console.log('res',res)
+              if (res) {
+                func.downloadFileByBlobHandler(res);
+                this.escHandler()
+              }
+            });
+          }else {
+            this.tableHeadData.map(item => item.prop)
+              .forEach((prop, index) => {
+                this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop;
+              });
+            exportCode({codeClassifyOid:this.codeClassifyOid,...this.exportArrTwo,limit:this.limit,page: start, endPage: end}).then(res=>{
+              // console.log('res',res)
+              if(res){
+                func.downloadFileByBlobHandler(res);
+                this.escHandler()
+              }
+            })
+          }
         }
-
-      }
-
     },
   }
 }

--
Gitblit v1.9.3