人员导入功能

yishuixian
zzq 2024-11-02 16:02:55 +08:00
parent 4692aad989
commit c9c9da5170
2 changed files with 54 additions and 5 deletions

View File

@ -7,11 +7,11 @@ NODE_ENV = development
#VUE_APP_BASE_API =http://60.217.22.153:9001/api
#VUE_APP_BASE_IMG_URL =http://60.217.22.153:9001
VUE_APP_BASE_API =http://60.217.22.153:9001/api
VUE_APP_BASE_IMG_URL =http://60.217.22.153:9001
# VUE_APP_BASE_API =http://60.217.22.153:9001/api
# VUE_APP_BASE_IMG_URL =http://60.217.22.153:9001
# VUE_APP_BASE_API =http://192.168.10.134:85/api
# VUE_APP_BASE_IMG_URL =http://192.168.10.134:85
VUE_APP_BASE_API =http://192.168.10.121:83/api
VUE_APP_BASE_IMG_URL =http://192.168.10.121:83

View File

@ -20,7 +20,19 @@
<el-button type="primary" size="mini" @click="add()" icon="el-icon-plus">添加</el-button>
<el-button type="warning" size="mini" @click="react()" icon="el-icon-edit">编辑</el-button>
<el-button type="danger" size="mini" @click="del()" icon="el-icon-delete">删除</el-button>
<el-upload
ref="upload"
style="display: inline;margin:0 15px;"
action="string"
accept=".xlsx,.xls"
:show-file-list="false"
:on-success="handleSuccess"
:on-exceed="handleExceed"
:http-request="UploadImage">
<el-button type="success" size="mini" icon="el-icon-upload2">导入</el-button>
</el-upload>
<el-button type="success" size="mini" @click="downfiles" icon="el-icon-download">模板下载</el-button>
</div>
</sticky>
<div class="app-container flex-item">
@ -156,6 +168,7 @@ export default {
},
data() {
return {
baseURL: process.env.VUE_APP_BASE_IMG_URL, //
tableKey: 0,
titleStr: "添加",
tableData: [],
@ -169,6 +182,7 @@ export default {
username: null,
},
detailInfo: [],
fileList: []
};
},
computed: {},
@ -237,6 +251,41 @@ export default {
this.editServiceVisible = true;
this.titleStr = "编辑";
},
//
handlePictureCardPreview(file) {
console.log('aaa',file)
},
handleExceed(files, fileList) {
this.$message.warning(`只能选择一个文件`);
},
UploadImage(param){
let formData = new FormData()
formData.append('files', param.file)
let url = 'http://192.168.10.121:83/api/Files/Upload'
postMethodCommon("/Files/Upload",formData).then(res =>{
console.log('asddsa',res)
let item = {
file_path :res.result[0].filePath
}
postMethodCommon("/FireCodeApp/BatchExportUser",item).then(response=>{
if(response.code == 200){
this.$message({
message: response.msg,
type: 'success'
});
}
})
})
},
handleSuccess(response,file,fileList){
},
downfiles(){
let url = this.baseURL + "/excel/人员信息模板.xlsx"
window.open(url)
},
rowClick(row) {
this.$refs.mainTable.clearSelection();
this.$refs.mainTable.toggleRowSelection(row);