|
@@ -130,7 +130,7 @@
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <div class="btn btn-medium btn-info" v-on:click="submitForm()">立即申请</div>
|
|
|
+ <div class="btn btn-medium btn-info" v-on:click="submitForm('project')">立即申请</div>
|
|
|
<div class="btn btn-medium" @click="resetForm('project')">重置</div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -147,6 +147,7 @@ import provincecity from '@/components/commons/ProvinceCity'
|
|
|
import provinceCityJSON from '@/constants/provinceCity.json'
|
|
|
import ServiceType from '@/constants/enum/service-type'
|
|
|
import ResourceType from '@/constants/enum/resource-type'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'ProjectCreate',
|
|
|
components: {
|
|
@@ -167,8 +168,8 @@ export default {
|
|
|
tabPosition: 'top',
|
|
|
institutionArray: Enum.institution,
|
|
|
platformType: [],
|
|
|
- serviceType:ServiceType,
|
|
|
- resourceType:ResourceType,
|
|
|
+ serviceType: ServiceType,
|
|
|
+ resourceType: ResourceType,
|
|
|
project: {
|
|
|
name: '',
|
|
|
contactName: '',
|
|
@@ -298,23 +299,18 @@ export default {
|
|
|
this.platformType.push(PlatformType[item])
|
|
|
})
|
|
|
},
|
|
|
- submitForm () {
|
|
|
- console.log(this.project)
|
|
|
- Http.posts(Apis.PROJECT.CREATE_PROJECT_SUBMIT, this.project).then((res) => {
|
|
|
- console.log(res.status)
|
|
|
+ submitForm (formName) {
|
|
|
+ this.$refs[formName].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ Http.post(Apis.PROJECT, this.project).then((res) => {
|
|
|
+ console.log(res.status)
|
|
|
+ })
|
|
|
+ //提交 project
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
})
|
|
|
- // this.$refs[formName].validate(valid => {
|
|
|
- // if (valid) {
|
|
|
- // console.log(this.project)
|
|
|
- // Http.post(Apis.PROJECT.CREATE_PROJECT_SUBMIT, this.project).then((res) => {
|
|
|
- // console.log(res)
|
|
|
- // })
|
|
|
- // //提交 project
|
|
|
- // } else {
|
|
|
- // console.log('error submit!!')
|
|
|
- // return false
|
|
|
- // }
|
|
|
- // })
|
|
|
},
|
|
|
resetForm (formName) {
|
|
|
this.$refs[formName].resetFields()
|
|
@@ -324,10 +320,8 @@ export default {
|
|
|
this.project.desc = ''
|
|
|
this.project.file = ''
|
|
|
this.project.doc = ''
|
|
|
- this.project.contact = {
|
|
|
- name: '',
|
|
|
- phone: ''
|
|
|
- }
|
|
|
+ this.project.contactName = ''
|
|
|
+ this.project.contactPhone = ''
|
|
|
|
|
|
this.project.resource = '非定向'
|
|
|
this.project.institution = ''
|
|
@@ -346,7 +340,7 @@ export default {
|
|
|
return isAPK && isDMG
|
|
|
},
|
|
|
loadData () {
|
|
|
- Http.get(Apis.PAGE.CREATE_PROJECT_PAGE).then((res) => {
|
|
|
+ Http.get(Apis.PAGE.PROJECT_DETAIL_PAGE).then((res) => {
|
|
|
this.project = res.project
|
|
|
})
|
|
|
}
|