xiejun
2023-12-07 05d45bd440ffc92e14e6c8728ac8956a0488c0ab
Source/UBCS-WEB/src/components/BatchImport/index.vue
@@ -13,7 +13,7 @@
      </li>
    </ul>
    <div
      v-show="currentTypeObj[type]['upParams'] === 'classifyAttr' && this.type !== 'bulkEdit'"
      v-show="currentTypeObj[type]['upParams'] === 'classifyAttr' && this.type !== 'bulkEdit'&& this.type !== 'groupCode'"
      class="radio_box"
    >
      <span>分类的路径使用的属性:</span>
@@ -61,22 +61,27 @@
      >
    </el-upload>
    <template #footer>
      <el-button
        v-if="type !== 'bulkEdit'"
        :loading="downloadLoading"
        size="small"
        type="primary"
        @click="downloadTemplateFun"
      >下载导入模板
      </el-button>
      <el-button v-if="type === 'bulkEdit'"
                 :loading="downloadLoading"
                 size="small"
                 type="primary"
                 @click="downloadTemplateFun"
      >下载编辑模板
      </el-button>
      <el-button size="small" @click="dialogVisible = false">关闭</el-button>
      <div style="display: inline-block" v-if="type != 'groupCode'">
          <el-button
            v-if="type !== 'bulkEdit' "
            :loading="downloadLoading"
            size="small"
            type="primary"
            @click="downloadTemplateFun"
          >下载导入模板
          </el-button>
          <el-button v-if="type === 'bulkEdit'"
                     :loading="downloadLoading"
                     size="small"
                     type="primary"
                     @click="downloadTemplateFun"
          >下载编辑模板
          </el-button>
        </div>
        <div style="display: inline-block">
          <el-button size="small" @click="dialogVisible = false">关闭</el-button>
        </div>
    </template>
    <ShowImportData
      v-if="showVisible"
@@ -189,6 +194,10 @@
        return {
          codeClassifyOid: this.codeClassifyOid,
        };
      } else if (this.type === 'groupCode') {
        return {
          codeClassifyOid: this.codeClassifyOid,
        };
      }
    },
  },
@@ -248,6 +257,17 @@
          downloadTemplateFun: downloadBatchApplyCodeTemplate,
          upParams: "classifyAttr",
        },
        groupCode: {
          title: "集团码导入",
          tipList: [
            "1.标题带五角星的表示关键属性,带星号表示必输项",
            "2.每次仅能最多导入5000条数据(可通过nacos进行配置,推荐5000/次导入),如果出错会返回错误的数据和原因,但是正确数据可以继续保存",
            "3.Excel第一行和第二行依次为企业编码和集团编码(必填)"
          ],
          action: "/api/ubcs-code/mdmEngineController/importGroupCode",
          downloadTemplateFun: null,
          upParams: "classifyAttr",
        }
      },
      secDTOList: [],
    };
@@ -291,16 +311,9 @@
        return;
      }
      if (this.type === 'bulkEdit') {
        this.tableHeadFindData.map(item => item.prop)
          .forEach((prop, index) => {
            this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop;
          });
        downloadExcelBatchEdit({
          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('下载成功,请查看!')
@@ -310,6 +323,7 @@
      }
    },
    onSuccess(res) {
      console.log(res)
      if (Object.keys(res.data).length === 0) {
        this.$message.success(this.title + "导入成功!");
        this.resetTable()