|
@@ -157,6 +157,7 @@ import provinceCityJSON from '@/constants/provinceCity.json'
|
|
|
import ServiceType from '@/constants/enum/service-type'
|
|
|
import ResourceType from '@/constants/enum/resource-type'
|
|
|
import {notify} from '@/constants/index'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'ProjectCreate',
|
|
|
components: {
|
|
@@ -312,7 +313,7 @@ export default {
|
|
|
// })
|
|
|
},
|
|
|
submitForm (formName) {
|
|
|
- console.log(this.project)
|
|
|
+ //console.log(this.project)
|
|
|
const newProject = {
|
|
|
userId: 3,
|
|
|
name: this.project.name,
|
|
@@ -332,13 +333,17 @@ export default {
|
|
|
price: this.project.price
|
|
|
}
|
|
|
Http.post(Apis.PROJECT.CREATE_PROJECT, newProject).then((res) => {
|
|
|
- //console.log(res.status)
|
|
|
+ notify('success', '创建成功')
|
|
|
if (window.history.length <= 1) {
|
|
|
this.$router.push({path: '/'})
|
|
|
return false
|
|
|
} else {
|
|
|
this.$router.go(-1)
|
|
|
}
|
|
|
+ }).catch(error => {
|
|
|
+ //console.log(error)
|
|
|
+ notify('error', error.data.msg)
|
|
|
+
|
|
|
})
|
|
|
// this.$refs[formName].validate(valid => {
|
|
|
// if (valid) {
|