sunjh %!s(int64=6) %!d(string=hai) anos
pai
achega
85f9168346
Modificáronse 2 ficheiros con 10 adicións e 6 borrados
  1. 9 4
      src/components/task/Task.vue
  2. 1 2
      src/components/task/TaskCreate.vue

+ 9 - 4
src/components/task/Task.vue

@@ -120,7 +120,7 @@ export default {
       institutionArray: Enum.institution,
       tabPosition: 'top',
       resourceType: ResourceType,
-      serviceType:ServiceType,
+      serviceType: ServiceType,
       taskId: 0,
       projectId: 0,
       task: {},
@@ -225,6 +225,11 @@ export default {
       this.$refs[formName].validate(valid => {
         if (valid) {
           this.isModifyMode = false
+          //修改TASK
+          Http.put(Apis.TASK, this.task).then((res) => {
+            console.log(this.task)
+            console.log(res)
+          })
           //提交 task
         } else {
           console.log('error submit!!')
@@ -244,8 +249,8 @@ export default {
       this.$refs[formName].resetFields()
       this.task.name = ''
       this.task.desc = ''
-      this.task.price= ''
-      this.task.budget= ''
+      this.task.price = ''
+      this.task.budget = ''
       this.task.type = ''
       this.task.resource = '2'; //如果是广场不用管Location和institution ,定向看institution,区域看location
       (this.task.location = {provinceCode: '', cityCode: ''}),
@@ -271,7 +276,7 @@ export default {
     },
     loadData () {
       //replace('{taskId}', this.taskId)
-      Http.get(Apis.PAGE.TASK_DETAIL_PAGE.replace('{taskId}', 0), {}).then((res) => {
+      Http.get(Apis.TASK + '0').then((res) => {
         this.task = res.task
         this.reportList = res.reportList
         console.log(this.task)

+ 1 - 2
src/components/task/TaskCreate.vue

@@ -196,8 +196,7 @@ export default {
     submitForm (formName) {
       this.$refs[formName].validate(valid => {
         if (valid) {
-          console.log(this.task)
-          Http.post(Apis.TASK.CREATE_TASK_SUBMIT, this.task).then((res) => {
+          Http.post(Apis.TASK, this.task).then((res) => {
             console.log(this.task)
             console.log(res)
           })