Source/plt-web/plt-web-ui/src/views/system/department/index.vue
@@ -25,9 +25,10 @@
      </template>
      <template slot="menuLeft" slot-scope="scope">
        <el-button icon="el-icon-school" plain size="small" type="primary" @click="assignMembersHandler">分配成员</el-button>
        <el-button icon="el-icon-school" plain size="small" type="primary" @click="assignMembersHandler">分配成员
        </el-button>
        <el-button icon="el-icon-user" plain size="small" type="primary" @click="statisticsHandler">统计</el-button>
        <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="statisticsHandler">导入部门</el-button>
        <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadHandler">导入部门</el-button>
        <el-button icon="el-icon-download" plain size="small" type="primary" @click="downLoadHandler">下载导入模板</el-button>
      </template>
    </avue-crud>
@@ -62,6 +63,10 @@
              :transferTitle="transferTitle" title="部门添加成员"
              @transferSend="departTransferSend">
    </transfer>
    <!-- 导入部门   -->
    <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导入部门"
                 @updata="getTableList"></upload-file>
  </basic-container>
</template>
@@ -131,12 +136,16 @@
            label: '角色',
            prop: 'pkPersonName',
            sortable: true,
            overHidden: true,
          },
        ]
      },
      leftTransferData: [],
      rightTransferData: [],
      transferTitle: ['待选人员', '已选人员'],
      tipList: ['导入模板中标明红色字体的为必输项', '导入结构为树结构时请保证ID列不能重复', '父ID请使用界面上部门的唯一标识ID或者Excel中手动输入的ID', '父ID列为空时,导入的部门即为顶层部门'],
      upFileType: ['xls', 'xlsx'],
      fileUrl: 'api/departmentQueryController/importDept',
    }
  },
  methods: {
@@ -273,7 +282,6 @@
      }
      countSmUserByDeptOid({pkDepartment: this.departCurrenRow.ALLDept === 'ALLDept' ? null : this.departCurrenRow.oid}).then(res => {
        console.log(res);
        if (res.data.code === 200) {
          const data = res.data.data;
          this.countData = data.map(item => {
@@ -339,13 +347,18 @@
    },
    // 下载导入模板
    downLoadHandler(){
    downLoadHandler() {
      download().then(res => {
        func.downloadFileByBlobHandler(res);
        this.$message.success('下载成功')
      }).catch(err => {
        this.$message.error(err);
      })
    },
    // 导入部门
    upLoadHandler() {
      this.$refs.upload.visible = true;
    }
  }
}