|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="create-container">
|
|
|
- <div class="create-body">
|
|
|
+ <div class="create-body" v-loading="loading">
|
|
|
<div class="title">创建项目</div>
|
|
|
<el-tabs tabPosition="top" type="card">
|
|
|
<el-tab-pane label="单个创建项目">
|
|
@@ -242,6 +242,7 @@ export default {
|
|
|
return {
|
|
|
userId: 0,
|
|
|
user: {},
|
|
|
+ loading:false,
|
|
|
dialogVisible: false,
|
|
|
isModifyMode: true,
|
|
|
serviceType: [],
|
|
@@ -486,19 +487,22 @@ export default {
|
|
|
|
|
|
},
|
|
|
uploadProjectCreateExcelFile (param) {
|
|
|
+ this.showLoading()
|
|
|
const formData = new FormData()
|
|
|
let config = {
|
|
|
//添加请求头
|
|
|
headers: {'Content-Type': 'multipart/form-data'},
|
|
|
}
|
|
|
formData.append('file', param.file)
|
|
|
- Http.upload(Apis.PROJECT.ADD_PROJECT_BY_EXCEL_PRE, formData, config).then((res) => {
|
|
|
+ Http.upload(Apis.PROJECT.ADD_PROJECT_BY_EXCEL_PRE.replace('{userId}', this.user.userVO.id), formData, config).then((res) => {
|
|
|
console.log(res)
|
|
|
this.projectList = res.data
|
|
|
+ this.hideLoading()
|
|
|
this.showDialog()
|
|
|
//notify('success', '项目添加成功')
|
|
|
}).catch(error => {
|
|
|
notify('error', error)
|
|
|
+ this.hideLoading()
|
|
|
})
|
|
|
},
|
|
|
uploadRequireDoc (param) {
|
|
@@ -545,11 +549,14 @@ export default {
|
|
|
// })
|
|
|
},
|
|
|
ensureSubmitExcel () {
|
|
|
+ this.showLoading()
|
|
|
Http.post(Apis.PROJECT.ADD_PROJECT_BY_EXCEL, this.projectList).then((res) => {
|
|
|
notify('success', '添加成功')
|
|
|
+ this.hideLoading()
|
|
|
this.hideDialog()
|
|
|
}).catch((error) => {
|
|
|
notify('error', error.data)
|
|
|
+ this.hideLoading()
|
|
|
})
|
|
|
},
|
|
|
showDialog () {
|
|
@@ -560,10 +567,10 @@ export default {
|
|
|
//this.resetForm()
|
|
|
},
|
|
|
setServiceType () {
|
|
|
- getAllServiceTypes().then((res)=>{
|
|
|
+ getAllServiceTypes().then((res) => {
|
|
|
this.serviceType = res
|
|
|
- }).catch((error)=>{
|
|
|
- notify('error','获取服务类型出错')
|
|
|
+ }).catch((error) => {
|
|
|
+ notify('error', '获取服务类型出错')
|
|
|
})
|
|
|
},
|
|
|
setPlatformType () {
|
|
@@ -611,10 +618,16 @@ export default {
|
|
|
},
|
|
|
setUserInfo () {
|
|
|
this.user = storageGet('user')
|
|
|
+ },
|
|
|
+ showLoading(){
|
|
|
+ this.loading = true
|
|
|
+ },
|
|
|
+ hideLoading(){
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
},
|
|
|
- watch:{
|
|
|
- serviceType(val){
|
|
|
+ watch: {
|
|
|
+ serviceType (val) {
|
|
|
this.serviceType = val
|
|
|
}
|
|
|
},
|