sunjh 6 jaren geleden
bovenliggende
commit
22b2866604

+ 4 - 113
src/components/project/Project.vue

@@ -460,120 +460,11 @@ export default {
     modifyForm () {
       this.isModifyMode = true
       //获得update 信息
-      this.project = {
-        name: '项目名',
-        code: '27382hdsjkfdskfK',
-        contact: {
-          name: '小王',
-          phone: '13818022817'
-        },
-        type: ['安全漏洞扫描'],
-        platform: ['0', '1'],
-        desc: '需求描述文字',
-        doc: '',
-        file: 'http://a.apk',
-        resource: '1',
-        location: {provinceCode: '3200', cityCode: '3201'},
-        institution: '',
-        datetime: new Date('2018-11-11 23:11:11'),
-        price: '400',
-        usage: '练习',
-        budget: '100',
-      }
-      this.task = [
-        {
-          id: '1',
-          name: '任务1',
-          desc: '任务描述文字',
-          type: '安全漏洞扫描',
-          resource: '1',
-          location: {provinceCode: '', cityCode: ''},
-          institution: '',
-          datetime: '2018-11-12 11:11:01',
-          worker: ''
-        },
-        {
-          id: '2',
-          name: '任务2',
-          desc: '任务描述文字',
-          type: '接口测试',
-          resource: '1',
-          location: {provinceCode: '', cityCode: ''},
-          institution: '上软',
-          datetime: '2018-11-11 10:11:01',
-          worker: ''
-        },
-        {
-          id: '3',
-          name: '任务3',
-          desc: '任务描述文字',
-          type: '功能测试服务',
-          resource: '1',
-          location: {provinceCode: '3200', cityCode: '3201'},
-          institution: '',
-          datetime: '2018-11-11 11:11:01',
-          worker: ''
-        }
-      ]
+      this.loadData()
     },
     cancelMode (formName) {
       this.isModifyMode = false
-      //获得update 信息
-      this.project = {
-        name: '项目名',
-        code: '27382hdsjkfdskfK',
-        contact: {
-          name: '小王',
-          phone: '13818022817'
-        },
-        type: ['安全漏洞扫描'],
-        platform: ['0', '1'],
-        desc: '需求描述文字',
-        doc: '',
-        file: 'http://a.apk',
-        resource: '1',
-        location: {provinceCode: '3200', cityCode: '3201'},
-        institution: '',
-        datetime: new Date('2018-11-11 23:11:11'),
-        price: '400',
-        usage: '练习',
-        budget: '100',
-      }
-      this.task = [
-        {
-          id: '1',
-          name: '任务1',
-          desc: '任务描述文字',
-          type: '安全漏洞扫描',
-          resource: '1',
-          location: {provinceCode: '3200', cityCode: '3201'},
-          institution: '',
-          datetime: '2018-11-12 11:11:01',
-          worker: ''
-        },
-        {
-          id: '2',
-          name: '任务2',
-          desc: '任务描述文字',
-          type: '接口测试',
-          resource: '1',
-          location: {provinceCode: '3200', cityCode: '3201'},
-          institution: '',
-          datetime: '2018-11-11 10:11:01',
-          worker: ''
-        },
-        {
-          id: '3',
-          name: '任务3',
-          desc: '任务描述文字',
-          type: '功能测试服务',
-          resource: '1',
-          location: {provinceCode: '3200', cityCode: '3201'},
-          institution: '',
-          datetime: '2018-11-11 11:11:01',
-          worker: ''
-        }
-      ]
+      this.loadData()
 
     },
     goToTaskDetail (id) {
@@ -609,8 +500,8 @@ export default {
     handleReject (index, id) {
       console.log('拒绝')
     },
-    loadData () {
-      Http.get(Apis.PAGE.PROJECT_DETAIL_PAGE.replace('{projectId}','PROJECT_1')).then((res) => {
+    loadData () {//.replace('{projectId}','PROJECT_1')
+      Http.get(Apis.PAGE.PROJECT_DETAIL_PAGE).then((res) => {
         console.log(res)
         this.project = res.projectDetails
         this.task = res.taskList

+ 15 - 3
src/components/task/Task.vue

@@ -4,14 +4,22 @@
     <div class="create-body">
       <div class="title h2" v-if="!isModifyMode">基本信息</div>
       <el-form :model="task" :rules="rules" ref="task" label-width="12%" class="demo-task">
-        <el-form-item label="任务名称" prop="title">
+        <el-form-item label="任务名称" prop="name">
           <el-input v-if="isModifyMode" v-model="task.title"></el-input>
           <span v-if="!isModifyMode">{{task.title}}</span>
         </el-form-item>
-        <el-form-item label="任务描述" prop="description">
+        <el-form-item label="任务描述" prop="desc">
           <el-input v-if="isModifyMode" type="textarea" v-model="task.description"></el-input>
           <span v-if="!isModifyMode">{{task.description}}</span>
         </el-form-item>
+        <el-form-item label="任务报价" prop="price">
+          <el-input v-if="isModifyMode" v-model="task.price"></el-input>
+          <span v-if="!isModifyMode">{{task.price}}</span>
+        </el-form-item>
+        <el-form-item label="任务定价" prop="budget">
+          <el-input v-if="isModifyMode" v-model="task.budget"></el-input>
+          <span v-if="!isModifyMode">{{task.budget}}</span>
+        </el-form-item>
         <el-form-item label="业务类型" prop="serviceType">
           <el-radio-group v-if="isModifyMode" v-model="task.serviceType">
             <el-radio :label="serviceType[0]" name="type"></el-radio>
@@ -159,7 +167,9 @@ export default {
         type: [
           {required: true, message: '请选择业务类型', trigger: 'change'}
         ],
-        desc: [{required: true, message: '请填写任务描述', trigger: 'blur'}]
+        desc: [{required: true, message: '请填写任务描述', trigger: 'blur'}],
+        price: [{required: true, message: '请填写任务报价', trigger: 'blur'}],
+        budget: [{required: true, message: '请填写任务定价', trigger: 'blur'}]
       }
     }
   },
@@ -234,6 +244,8 @@ export default {
       this.$refs[formName].resetFields()
       this.task.name = ''
       this.task.desc = ''
+      this.task.price= ''
+      this.task.budget= ''
       this.task.type = ''
       this.task.resource = '2'; //如果是广场不用管Location和institution ,定向看institution,区域看location
       (this.task.location = {provinceCode: '', cityCode: ''}),

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

@@ -9,6 +9,12 @@
         <el-form-item label="任务描述" prop="desc">
           <el-input type="textarea" v-model="task.desc"></el-input>
         </el-form-item>
+        <el-form-item label="任务报价" prop="price">
+          <el-input v-model="task.price"></el-input>
+        </el-form-item>
+        <el-form-item label="任务定价" prop="budget">
+          <el-input v-model="task.budget"></el-input>
+        </el-form-item>
         <el-form-item label="业务类型" prop="type">
           <el-radio-group v-model="task.type">
             <el-radio label="接口测试" name="type"></el-radio>
@@ -135,7 +141,9 @@ export default {
         type: [
           {required: true, message: '请选择业务类型', trigger: 'change'}
         ],
-        desc: [{required: true, message: '请填写任务描述', trigger: 'blur'}]
+        desc: [{required: true, message: '请填写任务描述', trigger: 'blur'}],
+        price: [{required: true, message: '请填写任务报价', trigger: 'blur'}],
+        budget: [{required: true, message: '请填写任务定价', trigger: 'blur'}]
       }
     }
   },

+ 12 - 12
src/js/http.js

@@ -4,17 +4,17 @@ const TIME_OUT_MS = 60 * 1000 // 默认请求超时时间
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
 
 // 请求拦截器
-// axios.interceptors.request.use(function (config) {
-//   return config
-// }, function (error) {
-//   return Promise.reject(error)
-// })
-// // 响应拦截器
-// axios.interceptors.response.use(function (response) {
-//   return response
-// }, function (error) {
-//   return Promise.reject(error)
-// })
+axios.interceptors.request.use(function (config) {
+  return config
+}, function (error) {
+  return Promise.reject(error)
+})
+// 响应拦截器
+axios.interceptors.response.use(function (response) {
+  return response
+}, function (error) {
+  return Promise.reject(error)
+})
 
 /*
  * @param response 返回数据列表
@@ -48,7 +48,7 @@ function handleResults (response) {
 }
 
 function handleUrl (url) {
-  url = 'http://crowd.mooctest.net' + url
+  //url = 'http://crowd.mooctest.net' + url
   return url
 }
 

+ 44 - 117
src/mock/getProjectDetailMock.js

@@ -1,128 +1,55 @@
 var Mock = require('mockjs')
 var data = Mock.mock({
-  'project': {
-    'name': '项目名',
-    'id': '27382hdsjkfdskfK', //项目编号
-    'contact': {
-      'name': '小王',
-      'phone': '12426177281'
+  'projectDetails': {
+    'id': 'PROJECT_1',
+    'name': '慕测平台',
+    'contactName': '郭超超',
+    'contactPhone': '18032653383',
+    'type': '1',
+    'platform': 'ceshi',
+    'desc': 'ceshi',
+    'doc': 'ceshi',
+    'file': 'cehsi',
+    'resource': 1,
+    'location': {
+      'provinceCode': '100',
+      'cityCode': '2333'
     },
-    // 0: "接口测试",
-    // 1: "安全漏洞扫描",
-    // 2: "风险评估服务",
-    // 3: "源代码安全审计服务",
-    // 4: "功能测试服务",
-    // 5: "性能测试",
-    // 6: "功能和易用性测试",
-    'type': ['安全漏洞扫描'],
-    'platform': ['0', '1'],
-    'desc': '需求描述文字',
-    'doc': '',
-    'file': 'http://a.apk',
-    // 0: "定向",
-    // 1: "区域",
-    // 2: "广场",
-    'resource': '1',
-    //当项目发布类型为0或2时,location字段无效;发布类型为1时,location字段表示接收项目的区域
-    'location': {'provinceCode': '3200', 'cityCode': '3201'},
-    //当项目发布类型为1或2时,institution字段无效;发布类型为0时,institution字段表示接收项目的区域
-    'institution': '',
-    'datetime': new Date("2018-11-11 23:11:11"), //new Date("2018-11-11 23:11:11"),
-    'price': '400',
-    'useage': '练习',
-    'budget': '100',
-    'task': [
-      {
-        'id': '1',
-        'name': '任务1',
-        'desc': '任务描述文字',
-        'type': '安全漏洞扫描',
-        // 0: "定向",
-        // 1: "区域",
-        // 2: "广场",
-        'resource': '1',
-        //当项目发布类型为0或2时,location字段无效;发布类型为1时,location字段表示接收项目的区域
-        'location': {'provinceCode': '3200', 'cityCode': '3201'},
-        //当项目发布类型为1或2时,institution字段无效;发布类型为0时,institution字段表示接收项目的区域
-        'institution': '',
-        //任务截止时间
-        'datetime': new Date("2018-11-11 23:11:11"),
-        // 如已分配,则为测评机构id,否则为空
-        'worker': ''
-      },
-      {
-        'id': '1',
-        'name': '任务1',
-        'desc': '任务描述文字',
-        'type': '安全漏洞扫描',
-        // 0: "定向",
-        // 1: "区域",
-        // 2: "广场",
-        'resource': '1',
-        //当项目发布类型为0或2时,location字段无效;发布类型为1时,location字段表示接收项目的区域
-        'location': {'provinceCode': '3200', 'cityCode': '3201'},
-        //当项目发布类型为1或2时,institution字段无效;发布类型为0时,institution字段表示接收项目的区域
-        'institution': '',
-        'datetime': new Date("2018-11-11 23:11:11"),
-        'worker': ''
-      }
-    ],
-    'reportList': [
-      {
-        'id': 1,
-        // 报告类型
-        // 0: "接口测试",
-        // 1: "安全漏洞扫描",
-        // 2: "风险评估服务",
-        // 3: "源代码安全审计服务",
-        // 4: "功能测试服务",
-        // 5: "性能测试",
-        // 6: "功能和易用性测试",
-        'type': 0,
-        'file': [{'name': 'report2', 'url': 'report2.excel'}]
-      },
-      {
-        'id': 2,
-        // 报告类型
-        // 0: "接口测试",
-        // 1: "安全漏洞扫描",
-        // 2: "风险评估服务",
-        // 3: "源代码安全审计服务",
-        // 4: "功能测试服务",
-        // 5: "性能测试",
-        // 6: "功能和易用性测试",
-        'type': 1,
-        //报告文件
-        'file': [{'name': 'report2', 'url': 'report2.excel'}]
-      }
-    ]
+    'institution': 6,
+    'datetime': '2019-07-29T20:54:23.000+0000',
+    'price': 20.0,
+    'budget': 20.0,
+    'usage': null
   },
-  'analyseDemandList': [
+  'taskList': [
     {
-      'id': '1',
-      'institution': '上软',
-      'feasibilityReport': {
-        'name': '可行性分析报告',
-        'url': 'feasibilityReport.docx'
-      },
-      'priceAuditReport': {
-        'name': '价格审核报告',
-        'url': 'priceAuditReport.docx'
-      }
+      'id': 1,
+      'name': '慕测平台-任务一',
+      'crowdTestProjectId': null,
+      'evaluationAgencyId': 1,
+      'type': '0',
+      'description': null,
+      'requirementFile': null,
+      'quotedPrice': 10.0,
+      'fixedPrice': null,
+      'status': 'HAS_CREATED',
+      'createTime': '2019-07-29T21:08:54.000+0000'
     },
     {
-      'id': '1',
-      'institution': '上软',
-      'feasibilityReport': {
-        'name': '可行性分析报告',
-        'url': 'feasibilityReport.docx'
-      },
-      'priceAuditReport': {
-        'name': '价格审核报告',
-        'url': 'priceAuditReport.docx'
-      }
+      'id': 2,
+      'name': '慕测平台-任务二',
+      'crowdTestProjectId': null,
+      'evaluationAgencyId': 2,
+      'type': '0',
+      'description': null,
+      'requirementFile': null,
+      'quotedPrice': 10.0,
+      'fixedPrice': null,
+      'status': 'HAS_CREATED',
+      'createTime': '2019-07-29T21:08:56.000+0000'
     }
-  ]
+  ],
+  'reportList': null
 })
 
 export {

+ 1 - 0
src/mock/getTaskDetailMock.js

@@ -10,6 +10,7 @@ var data = Mock.mock({
     'title': '多人聊天发送文件测试',
     //任务描述
     'description': '任务描述文字xxxx',
+    'budget':0,
     //任务定价
     'price': 10,
     //项目发布类型:定向或非定向