|
@@ -96,7 +96,21 @@
|
|
@click="upState()"
|
|
@click="upState()"
|
|
:loading="loading"
|
|
:loading="loading"
|
|
v-if="butPrivilege.CHECK && isCheck"
|
|
v-if="butPrivilege.CHECK && isCheck"
|
|
- >审核</el-button>
|
|
|
|
|
|
+ >审核</el-button>
|
|
|
|
+ <el-upload
|
|
|
|
+ v-if="butPrivilege.IMPORT"
|
|
|
|
+ style="display: inline-block;margin-left:5px"
|
|
|
|
+ action=""
|
|
|
|
+ :on-progress='beforeUpload'
|
|
|
|
+ :multiple='false'
|
|
|
|
+ :limit="1"
|
|
|
|
+ accept=".xls"
|
|
|
|
+ :show-file-list="false"
|
|
|
|
+ ><el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ :loading='loading'>导入</el-button>
|
|
|
|
+ </el-upload>
|
|
<el-button
|
|
<el-button
|
|
class="button"
|
|
class="button"
|
|
size="mini"
|
|
size="mini"
|
|
@@ -856,7 +870,8 @@ export default {
|
|
QUERY: false,
|
|
QUERY: false,
|
|
PUT: false,
|
|
PUT: false,
|
|
CHECK: false,
|
|
CHECK: false,
|
|
- UNDOCHECK: false
|
|
|
|
|
|
+ UNDOCHECK: false,
|
|
|
|
+ IMPORT: false
|
|
},
|
|
},
|
|
loginName: getCookie('loginName')
|
|
loginName: getCookie('loginName')
|
|
}
|
|
}
|
|
@@ -1741,6 +1756,26 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
|
|
+ },
|
|
|
|
+ // 导入方法
|
|
|
|
+ beforeUpload (event, file, fileList) {
|
|
|
|
+ let _this = this
|
|
|
|
+ let formData = new FormData();
|
|
|
|
+ formData.append('file', file.raw)
|
|
|
|
+ _this.loading = true
|
|
|
|
+ this.axios.post('pass/ems/v1/emsprodplanyears/excelimport/', formData, {
|
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'}
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.code === '200') {
|
|
|
|
+ this.$message.success('操作成功')
|
|
|
|
+ _this.getTableData();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.message)
|
|
|
|
+ }
|
|
|
|
+ _this.loading = false
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ _this.loading = false
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|