|
|
@@ -223,9 +223,8 @@
|
|
|
<script>
|
|
|
import Http from '@/js/http.js'
|
|
|
import Apis from '@/js/api.js'
|
|
|
-import PlatformType from '@/constants/enum/platform-type.js'
|
|
|
import {notify} from '@/constants/index'
|
|
|
-import {getAllServiceTypes,getAllPlatformTypes} from '@/js/index'
|
|
|
+import {getAllPlatformTypes, getAllServiceTypes} from '@/js/index'
|
|
|
|
|
|
export default {
|
|
|
name: 'ProjectAdd',
|
|
|
@@ -449,7 +448,7 @@ export default {
|
|
|
datetime: this.project.datetime
|
|
|
}
|
|
|
Http.post(Apis.PROJECT.ADD_PROJECT, newProject).then((res) => {
|
|
|
- notify('success', '项目添加成功')
|
|
|
+ this.createProjectByFormSuccessConfirm()
|
|
|
console.log(res)
|
|
|
}).catch(error => {
|
|
|
notify('error', error.data.msg)
|
|
|
@@ -544,13 +543,53 @@ export default {
|
|
|
},
|
|
|
hideDialog () {
|
|
|
this.dialogVisible = false
|
|
|
- this.resetForm()
|
|
|
+ //this.resetForm()
|
|
|
},
|
|
|
setServiceType () {
|
|
|
this.serviceType = getAllServiceTypes()
|
|
|
},
|
|
|
- setPlatformType (){
|
|
|
+ setPlatformType () {
|
|
|
this.platforms = getAllPlatformTypes()
|
|
|
+ },
|
|
|
+ createProjectByFormSuccessConfirm () {
|
|
|
+ this.$confirm('项目创建成功,是否跳转至主页?', '提示', {
|
|
|
+ confirmButtonText: '跳转至主页',
|
|
|
+ cancelButtonText: '继续创建项目',
|
|
|
+ type: 'success'
|
|
|
+ }).then(() => {
|
|
|
+ this.$router.push({
|
|
|
+ name: 'Home',
|
|
|
+ // params: {projectId: projectId, taskId: taskId}
|
|
|
+ })
|
|
|
+ // this.$message({
|
|
|
+ // type: 'success',
|
|
|
+ // message: '删除成功!'
|
|
|
+ // });
|
|
|
+ }).catch(() => {
|
|
|
+ this.resetForm()
|
|
|
+ // this.$message({
|
|
|
+ // type: 'info',
|
|
|
+ // message: '已取消删除'
|
|
|
+ // });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ resetForm () {
|
|
|
+ this.project = {
|
|
|
+ name: '',
|
|
|
+ description: '',
|
|
|
+ contactName: '',
|
|
|
+ contactPhone: '',
|
|
|
+ platform: [],
|
|
|
+ type: [],
|
|
|
+ requireDoc: [],
|
|
|
+ requireDocUrl: '',
|
|
|
+ file: [],
|
|
|
+ fileUrl: '',
|
|
|
+ excelFile: [],
|
|
|
+ excelFileUrl: '',
|
|
|
+ price: '',
|
|
|
+ datetime: ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
created: function () {
|