|
|
@@ -132,7 +132,12 @@ import ReportList from '@/components/report/ReportList'
|
|
|
import Http from '@/js/http.js'
|
|
|
import Apis from '@/js/api.js'
|
|
|
import {notify} from '@/constants/index'
|
|
|
-import {getAllInstitutions, getAllServiceTypes} from '@/js/index'
|
|
|
+import {
|
|
|
+ getAllInstitutions,
|
|
|
+ getAllServiceTypes,
|
|
|
+ getProvinceCodeByProvinceName,
|
|
|
+ getProvinceNameByProvinceCode
|
|
|
+} from '@/js/index'
|
|
|
|
|
|
export default {
|
|
|
name: 'Task',
|
|
|
@@ -261,32 +266,32 @@ export default {
|
|
|
return provinceName + ' / ' + cityName
|
|
|
},
|
|
|
submitForm (formName) {
|
|
|
- console.log(this.task)
|
|
|
- this.$refs[formName].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.isModifyMode = false
|
|
|
- const newTask = {
|
|
|
- name: this.task.title,
|
|
|
- desc: this.task.description,
|
|
|
- type: this.task.serviceType,
|
|
|
- resource: this.task.resource,
|
|
|
- location: this.task.location,
|
|
|
- institution: this.task.institution,
|
|
|
- datetime: this.task.datetime,
|
|
|
- quotePrice: this.task.quotePrice,
|
|
|
- fixedPrice: this.task.fixedPrice,
|
|
|
- requireDoc: this.task.requireDocUrl
|
|
|
- }
|
|
|
- //修改TASK
|
|
|
- Http.put(Apis.TASK.UPDATE_TASK.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId), newTask).then((res) => {
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- //提交 task
|
|
|
- } else {
|
|
|
- console.log('error submit!!')
|
|
|
- return false
|
|
|
- }
|
|
|
+ const newTask = {
|
|
|
+ name: this.task.title,
|
|
|
+ desc: this.task.description,
|
|
|
+ type: this.task.serviceType,
|
|
|
+ resource: this.task.resource,
|
|
|
+ location: getProvinceNameByProvinceCode(this.task.location.provinceCode, this.task.location.cityCode),
|
|
|
+ institution: this.task.institution,
|
|
|
+ datetime: this.task.datetime,
|
|
|
+ quotePrice: this.task.quotePrice,
|
|
|
+ fixedPrice: this.task.fixedPrice,
|
|
|
+ requireDoc: this.task.requireDocUrl
|
|
|
+ }
|
|
|
+ //修改TASK
|
|
|
+ Http.put(Apis.TASK.UPDATE_TASK.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId), newTask).then((res) => {
|
|
|
+ this.isModifyMode = false
|
|
|
+ console.log(res)
|
|
|
})
|
|
|
+ // this.$refs[formName].validate(valid => {
|
|
|
+ // if (valid) {
|
|
|
+ // this.isModifyMode = false
|
|
|
+ //
|
|
|
+ // } else {
|
|
|
+ // console.log('error submit!!')
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
cancelMode (formName) {
|
|
|
this.isModifyMode = false
|
|
|
@@ -358,7 +363,7 @@ export default {
|
|
|
this.task.description = res.crowdTaskVO.description
|
|
|
this.task.serviceType = res.crowdTaskVO.serviceType
|
|
|
this.task.resource = res.crowdTaskVO.resource
|
|
|
- this.task.location = res.crowdTaskVO.location
|
|
|
+ this.task.location = getProvinceCodeByProvinceName(res.crowdTaskVO.location.provinceCode, res.crowdTaskVO.location.cityCode)
|
|
|
this.task.institution = res.crowdTaskVO.institution
|
|
|
this.task.datetime = new Date(res.crowdTaskVO.datetime)
|
|
|
this.task.quotePrice = res.crowdTaskVO.quotePrice
|
|
|
@@ -426,7 +431,7 @@ export default {
|
|
|
this.serviceType = getAllServiceTypes()
|
|
|
},
|
|
|
setInstitutions () {
|
|
|
- this.institutionArray = getAllInstitutions();
|
|
|
+ this.institutionArray = getAllInstitutions()
|
|
|
}
|
|
|
},
|
|
|
// created () {
|