From 2655f16a2f6a977d0e378947d0865b02ec4121e1 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期四, 23 十一月 2023 16:56:50 +0800 Subject: [PATCH] 主数据申请接口变更+统计图表整合 --- Source/UBCS-WEB/src/components/BatchImport/index.vue | 88 ++++++++++++++++++++++++++++++++++--------- 1 files changed, 69 insertions(+), 19 deletions(-) diff --git a/Source/UBCS-WEB/src/components/BatchImport/index.vue b/Source/UBCS-WEB/src/components/BatchImport/index.vue index 1f156fe..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, @@ -182,15 +199,26 @@ tipList: [ "1.鏍囬甯︿簲瑙掓槦鐨勮〃绀哄叧閿睘鎬э紝甯︽槦鍙疯〃绀哄繀杈撻」", "2.浼佷笟缂栫爜锛岄泦鍥㈢爜鍜岀姸鎬侀兘闇�瑕佸鍏�", - "3.姣忔浠呰兘鏈�澶氬鍏�10000鏉℃暟鎹紝濡傛灉鍑洪敊浼氳繑鍥為敊璇殑鏁版嵁鍜屽師鍥狅紝浣嗘槸姝g‘鐨勬暟鎹細淇濆瓨", + "3.姣忔浠呰兘鏈�澶氬鍏�5000鏉℃暟鎹�(鍙�氳繃nacos杩涜閰嶇疆锛屾帹鑽�5000/娆″鍏�)锛屽鏋滃嚭閿欎細杩斿洖閿欒鐨勬暟鎹拰鍘熷洜锛屼絾鏄纭暟鎹彲浠ョ户缁繚瀛�", "4.鍒嗙被鐨勮矾寰勯渶瑕佺敤#鍒嗛殧銆備粎濉啓褰撳墠閫夌殑鍒嗙被鏍戜笂鐨勪笅绾у垎绫荤殑璺緞锛屽鏋滃綋鍓嶅垎绫诲凡缁忔槸鍙跺瓙鑺傜偣锛屽垯涓嶅~鍐�", ], action: "/api/ubcs-code/mdmEngineController/batchImportHistoryData", 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; } @@ -290,12 +340,12 @@ }, onError(err) { this.pageLoading.close(); - console.log('onError') + //console.log('onError') }, uploadChange(file) { if (file.status === "success" || file.status === "error") { this.pageLoading.close(); - console.log('uploadChange') + //console.log('uploadChange') } }, }, -- Gitblit v1.9.3