sunjh 6 年之前
父節點
當前提交
8189bd10f4
共有 3 個文件被更改,包括 37 次插入14 次删除
  1. 12 1
      src/components/project/Project.vue
  2. 21 11
      src/components/report/Report.vue
  3. 4 2
      src/js/api.js

+ 12 - 1
src/components/project/Project.vue

@@ -267,6 +267,8 @@ import Enum from "@/constants/enum/index";
 import PlatformType from "@/constants/enum/platform-type";
 import provinceCity from "@/constants/provinceCity.json";
 import ReportList from "@/components/report/ReportList";
+import Http from '@/js/http.js'
+import Apis from '@/js/api.js'
 export default {
   name: "Project",
   components: { ReportList },
@@ -487,7 +489,10 @@ export default {
       this.$refs[formName].validate(valid => {
         if (valid) {
           this.isModifyMode = false;
-          console.log(this.project);
+          Http.post(Apis.PROJECT.UPDATE_PROJECT_SUBMIT,this.project).then((res)=>{
+            console.log(res)
+            console.log(this.project)
+          })
           //提交 project
         } else {
           console.log("error submit!!");
@@ -662,6 +667,12 @@ export default {
     },
     handleReject(index, id) {
       console.log("拒绝");
+    },
+    loadData() {
+      Http.get(Apis.PAGE.PROJECT_DETAIL_PAGE).then((res)=>{
+        this.project = res.project
+        this.analyseDemandList = res.analyseDemandList
+      })
     }
   }
 };

+ 21 - 11
src/components/report/Report.vue

@@ -85,6 +85,8 @@
 </template>
 
 <script>
+import Http from '@/js/http.js'
+import Apis from '@/js/api.js'
 export default {
   name: "Report-Create",
   components: {},
@@ -135,22 +137,25 @@ export default {
     modifyForm() {
       this.isModifyMode = true;
       //请求 report
-      this.report = {
-        name: "测试报告1",
-        abstract: {
-          target: "测试对象xxxx",
-          content: "测试内容xxxxx"
-        },
-        file: [{ name: "report5", url: "report5.excel" }],
-        type: "项目测试方案",
-        conclusion: "app挺好"
-      };
+      // this.report = {
+      //   name: "测试报告1",
+      //   abstract: {
+      //     target: "测试对象xxxx",
+      //     content: "测试内容xxxxx"
+      //   },
+      //   file: [{ name: "report5", url: "report5.excel" }],
+      //   type: "项目测试方案",
+      //   conclusion: "app挺好"
+      // };
     },
     submitForm(formName) {
       this.$refs[formName].validate(valid => {
         if (valid) {
           this.isModifyMode = false;
-          console.log(this.report);
+          Http.post(Apis.REPORT.UPDATE_REPORT_SUBMIT,this.report).then((res)=>{
+            console.log(this.report)
+            console.log(res)
+          })
           //提交 report
         } else {
           console.log("error submit!!");
@@ -202,6 +207,11 @@ export default {
       } else {
         this.$router.go(-1);
       }
+    },
+    loadData() {
+      Http.get(Apis.PAGE.REPORT_DETAIL_PAGE).then((res)=>{
+        this.report = res.report
+      })
     }
   }
 };

+ 4 - 2
src/js/api.js

@@ -1,13 +1,15 @@
 export default {
   API: '/api/',
   PROJECT: {
-    CREATE_PROJECT_SUBMIT: this.API + 'project/createProject/'
+    CREATE_PROJECT_SUBMIT: this.API + 'project/createProject/',
+    UPDATE_PROJECT_SUBMIT: this.API + 'project/updateProject/',
   },
   TASK: {
     GET_HOT_TASK_LIST: '/api/task/getHotTaskList/'
   },
   REPORT: {
-    CREATE_REPORT_SUBMIT: this.API + 'report/createReport'
+    CREATE_REPORT_SUBMIT: this.API + 'report/createReport',
+    UPDATE_REPORT_SUBMIT: this.API + 'report/updateReport',
   },
   USER: {},
   PAGE: {