| | |
| | | </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"> |
| | |
| | | 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 |
| | |
| | | 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"; |
| | |
| | | type: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | tableHeadFindData:{ |
| | | type:Array, |
| | | default:[] |
| | | }, |
| | | selectRow:{ |
| | | type:Array, |
| | | default:[] |
| | | }, |
| | | resetTable: Function |
| | | }, |
| | |
| | | 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, |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | exportArrTwo: {}, |
| | | classifyAttr: "id", |
| | | downloadLoading: false, |
| | | showVisible: false, |
| | |
| | | "2.企业编码,集团码和状态都需要导入", |
| | | "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, |
| | |
| | | }, |
| | | // 下载导入模板 |
| | | 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) { |