|
|
@@ -200,7 +200,8 @@
|
|
|
<el-table-column prop="datetime" sortable label="任务截止时间"></el-table-column>
|
|
|
<el-table-column prop="resource" label="任务可见性">
|
|
|
<template slot-scope="scope">
|
|
|
- <div v-if="scope.row.resource=='1'">{{updateLocation(scope.row.location)}}</div>
|
|
|
+ <div v-if="scope.row.resource=='1'">{{scope.row.location.provinceCode}}/{{scope.row.location.cityCode}}
|
|
|
+ </div>
|
|
|
<div v-if="scope.row.resource=='0'">{{scope.row.institution}}</div>
|
|
|
<div v-if="scope.row.resource=='2'">{{resourceType[scope.row.resource]}}</div>
|
|
|
</template>
|
|
|
@@ -242,7 +243,6 @@ import Http from '@/js/http.js'
|
|
|
import Apis from '@/js/api.js'
|
|
|
import ResourceType from '@/constants/enum/resource-type'
|
|
|
import provincecity from '@/components/commons/ProvinceCity'
|
|
|
-import provinceCityJSON from '@/constants/provinceCity.json'
|
|
|
import {notify} from '@/constants/index'
|
|
|
import {
|
|
|
getAllInstitutions,
|
|
|
@@ -328,35 +328,35 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
rules: {
|
|
|
- name: [
|
|
|
- {required: true, message: '请输入项目名称', trigger: 'blur'}
|
|
|
- // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }
|
|
|
- ],
|
|
|
- type: [
|
|
|
- {
|
|
|
- type: 'array',
|
|
|
- required: true,
|
|
|
- message: '请至少选择一种服务类型',
|
|
|
- trigger: 'change'
|
|
|
- }
|
|
|
- ],
|
|
|
- platform: [
|
|
|
- {
|
|
|
- type: 'array',
|
|
|
- required: true,
|
|
|
- message: '请至少选择一个平台',
|
|
|
- trigger: 'change'
|
|
|
- }
|
|
|
- ],
|
|
|
- desc: [{required: true, message: '请填写活动形式', trigger: 'blur'}],
|
|
|
- contact: [{validator: validatePass, trigger: 'blur'}],
|
|
|
- resource: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请选择项目可见性',
|
|
|
- trigger: 'change'
|
|
|
- }
|
|
|
- ]
|
|
|
+ // name: [
|
|
|
+ // {required: true, message: '请输入项目名称', trigger: 'blur'}
|
|
|
+ // // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }
|
|
|
+ // ],
|
|
|
+ // type: [
|
|
|
+ // {
|
|
|
+ // type: 'array',
|
|
|
+ // required: true,
|
|
|
+ // message: '请至少选择一种服务类型',
|
|
|
+ // trigger: 'change'
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
+ // platform: [
|
|
|
+ // {
|
|
|
+ // type: 'array',
|
|
|
+ // required: true,
|
|
|
+ // message: '请至少选择一个平台',
|
|
|
+ // trigger: 'change'
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
+ // desc: [{required: true, message: '请填写活动形式', trigger: 'blur'}],
|
|
|
+ // contact: [{validator: validatePass, trigger: 'blur'}],
|
|
|
+ // resource: [
|
|
|
+ // {
|
|
|
+ // required: true,
|
|
|
+ // message: '请选择项目可见性',
|
|
|
+ // trigger: 'change'
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -372,42 +372,44 @@ export default {
|
|
|
institutionArray (val) {
|
|
|
this.institutionArray = val
|
|
|
},
|
|
|
- 'project.institution' () {
|
|
|
- if (this.project.institution) {
|
|
|
- //this.$refs.addFormProvince.resetProviceCity()
|
|
|
- this.project.location = {provinceCode: '', cityCode: ''}
|
|
|
- }
|
|
|
- },
|
|
|
- 'project.location' () {
|
|
|
- if (this.project.location.provinceCode || this.project.location.cityCode) {
|
|
|
- this.project.institution = ''
|
|
|
- }
|
|
|
- },
|
|
|
- 'project.resource' () {
|
|
|
- if (this.project.resource == '2') {
|
|
|
- this.$refs.addFormProvince.resetProviceCity()
|
|
|
- this.project.institution = ''
|
|
|
- this.project.location = {provinceCode: '', cityCode: ''}
|
|
|
- }
|
|
|
- },
|
|
|
+ // 'project.institution' () {
|
|
|
+ // if (this.project.institution) {
|
|
|
+ // //this.$refs.addFormProvince.resetProviceCity()
|
|
|
+ // this.project.location = {provinceCode: '', cityCode: ''}
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // 'project.location' () {
|
|
|
+ // if (this.project.location.provinceCode || this.project.location.cityCode) {
|
|
|
+ // this.project.institution = ''
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // 'project.resource' () {
|
|
|
+ // if (this.project.resource == '2') {
|
|
|
+ // //this.$refs.addFormProvince.resetProviceCity()
|
|
|
+ // this.project.institution = ''
|
|
|
+ // this.project.location = {provinceCode: '', cityCode: ''}
|
|
|
+ // }
|
|
|
+ // },
|
|
|
deep: true
|
|
|
},
|
|
|
methods: {
|
|
|
updateLocation (location) {
|
|
|
- var provinceName = ''
|
|
|
- var cityName = ''
|
|
|
- for (var item of provinceCityJSON.provinces) {
|
|
|
- if (item.code === location.provinceCode) {
|
|
|
- provinceName = item.name
|
|
|
- for (var city of item.cities) {
|
|
|
- if (city.code === location.cityCode) {
|
|
|
- cityName = city.name
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return provinceName + ' / ' + cityName
|
|
|
+ //console.log(location)
|
|
|
+ const loactionName = getProvinceNameByProvinceCode(location.provinceCode, location.cityCode)
|
|
|
+ // var provinceName = ''
|
|
|
+ // var cityName = ''
|
|
|
+ // for (var item of provinceCityJSON.provinces) {
|
|
|
+ // if (item.code === location.provinceCode) {
|
|
|
+ // provinceName = item.name
|
|
|
+ // for (var city of item.cities) {
|
|
|
+ // if (city.code === location.cityCode) {
|
|
|
+ // cityName = city.name
|
|
|
+ // break
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ return loactionName.provinceCode + ' / ' + loactionName.cityCode
|
|
|
},
|
|
|
init () {
|
|
|
this.projectId = this.$route.params.projectId
|
|
|
@@ -440,7 +442,7 @@ export default {
|
|
|
datetime: this.project.datetime,
|
|
|
usage: this.project.usage,
|
|
|
}
|
|
|
- //console.log(newProject)
|
|
|
+ console.log(newProject)
|
|
|
Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', this.projectId), newProject).then((res) => {
|
|
|
this.projectId = res.projectDetails.id
|
|
|
this.project.name = res.projectDetails.name
|
|
|
@@ -691,6 +693,10 @@ export default {
|
|
|
.el-row {
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
|
+
|
|
|
+ .el-input {
|
|
|
+ width: 400px;
|
|
|
+ }
|
|
|
</style>
|
|
|
|
|
|
|