From 71927d489198518e2a9e4188340dfbdc35caa3a2 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期三, 29 十一月 2023 10:46:08 +0800
Subject: [PATCH] 1.标准变系列,系列变系列测试 2.业务数据数据更改,直接发布
---
Source/UBCS-WEB/src/components/BatchImport/index.vue | 82 +++++++++++++++++++++++++++++++++--------
1 files changed, 66 insertions(+), 16 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/BatchImport/index.vue b/Source/UBCS-WEB/src/components/BatchImport/index.vue
index 0f7ca74..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,21 +267,43 @@
},
// 涓嬭浇瀵煎叆妯℃澘
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) {
this.$message.success(this.title + "瀵煎叆鎴愬姛锛�");
+ this.resetTable()
this.dialogVisible = false;
return;
}
--
Gitblit v1.9.3