From 47482f386cefd756e1d1a745a5b13949fd709c77 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期三, 22 十一月 2023 18:19:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/components/BatchImport/index.vue |   81 ++++++++++++++++++++++++++++++++--------
 1 files changed, 65 insertions(+), 16 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/BatchImport/index.vue b/Source/UBCS-WEB/src/components/BatchImport/index.vue
index 3df3124..02d31db 100644
--- a/Source/UBCS-WEB/src/components/BatchImport/index.vue
+++ b/Source/UBCS-WEB/src/components/BatchImport/index.vue
@@ -14,7 +14,7 @@
     </ul>
     <div
       class="radio_box"
-      v-show="currentTypeObj[type]['upParams'] === 'classifyAttr'"
+      v-show="currentTypeObj[type]['upParams'] === 'classifyAttr' && this.type !== 'bulkEdit'"
     >
       <span>鍒嗙被鐨勮矾寰勪娇鐢ㄧ殑灞炴��:</span>
       <el-radio-group v-model="classifyAttr">
@@ -65,8 +65,14 @@
         size="small"
         @click="downloadTemplateFun"
         :loading="downloadLoading"
-        >涓嬭浇瀵煎叆妯℃澘</el-button
-      >
+        v-if="type !== 'bulkEdit'"
+        >涓嬭浇瀵煎叆妯℃澘</el-button>
+      <el-button type="primary"
+                 size="small"
+                 :loading="downloadLoading"
+                 @click="downloadTemplateFun"
+                 v-if="type === 'bulkEdit'"
+                >涓嬭浇缂栬緫妯℃澘</el-button>
       <el-button size="small" @click="dialogVisible = false">鍏抽棴</el-button>
     </template>
     <ShowImportData
@@ -93,6 +99,8 @@
   downloadBatchImportApplyTemplate,
   downloadBatchApplyCodeTemplate,
 } from "../../api/batchImport/index";
+import {exportCode} from '@/api/GetItem'
+import func from "@/util/func";
 import FormTemplate from "../FormTemplate/FormTemplate.vue";
 import { getToken } from "@/util/auth";
 import codeApply from "@/mixins/codeApply.js";
@@ -116,6 +124,14 @@
     type: {
       type: String,
       default: "",
+    },
+    tableHeadFindData:{
+      type:Array,
+      default:[]
+    },
+    selectRow:{
+      type:Array,
+      default:[]
     },
     resetTable: Function
   },
@@ -146,7 +162,7 @@
       return this.currentTypeObj[this.type]["action"];
     },
     upParams() {
-      if (this.type === "historyImport" || this.type === "batchApplyCode") {
+      if (this.type === "historyImport" || this.type === "batchApplyCode" || this.type === "bulkEdit") {
         return {
           codeClassifyOid: this.codeClassifyOid,
           classifyAttr: this.classifyAttr,
@@ -169,6 +185,7 @@
   },
   data() {
     return {
+      exportArrTwo: {},
       classifyAttr: "id",
       downloadLoading: false,
       showVisible: false,
@@ -189,8 +206,19 @@
           downloadTemplateFun: downloadHistoryImportTemplate,
           upParams: "classifyAttr",
         },
+        bulkEdit:{
+          title: "鎵归噺缂栬緫瀵煎叆",
+          tipList: [
+            "1.鏍囬甯︿簲瑙掓槦鐨勮〃绀哄叧閿睘鎬э紝甯︽槦鍙疯〃绀哄繀杈撻」",
+            "2.姣忔浠呰兘鏈�澶氬鍏�5000鏉℃暟鎹�(鍙�氳繃nacos杩涜閰嶇疆锛屾帹鑽�5000/娆″鍏�)锛屽鏋滃嚭閿欎細杩斿洖閿欒鐨勬暟鎹拰鍘熷洜锛屼絾鏄纭暟鎹彲浠ョ户缁繚瀛�",
+            "3.璇锋寜鐓т笅杞界殑缂栬緫妯℃澘鎵�浣跨敤鐨勯厤缃繘琛屽叿浣撻厤缃�"
+          ],
+          action: "/api/ubcs-code/mdmEngineController/batchImportHistoryData",
+          downloadTemplateFun: downloadHistoryImportTemplate,
+          upParams: "classifyAttr",
+        },
         batchImportApply: {
-          title: "鎵归噺鐢宠缂栫爜",
+          title: "鎵归噺瀵煎叆鐢宠",
           tipList: [
             "1.鏍囬甯︿簲瑙掓槦鐨勮〃绀哄叧閿睘鎬э紝甯︽槦鍙疯〃绀哄繀杈撻」",
             "2.璇蜂竴瀹氬厛閫夋嫨/杈撳叆缂栫爜瑙勫垯鐨勭爜娈靛�煎悗鍐嶉�夋嫨excel鏂囦欢",
@@ -239,17 +267,38 @@
     },
     // 涓嬭浇瀵煎叆妯℃澘
     downloadTemplateFun() {
-      this.downloadLoading = true;
-      this.downloadTemplateApi({
-        codeClassifyOid: this.codeClassifyOid,
-      })
-        .then((res) => {
-          this.$utilFunc.downloadFileByBlob(res.data, this.title + "妯℃澘.xls");
-          this.downloadLoading = false;
-        })
-        .catch(() => {
-          this.downloadLoading = false;
-        });
+       if(this.type !== 'bulkEdit'){
+         this.downloadLoading = true;
+         this.downloadTemplateApi({
+           codeClassifyOid: this.codeClassifyOid,
+         })
+           .then((res) => {
+             this.$utilFunc.downloadFileByBlob(res.data, this.title + "妯℃澘.xls");
+             this.downloadLoading = false;
+           })
+           .catch(() => {
+             this.downloadLoading = false;
+           });
+         return;
+       }
+       if(this.type === 'bulkEdit'){
+         this.tableHeadFindData.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.$message.success('涓嬭浇鎴愬姛锛岃鏌ョ湅锛�')
+           }
+         })
+         return;
+       }
     },
     onSuccess(res) {
       if (Object.keys(res.data).length === 0) {

--
Gitblit v1.9.3