|
@@ -6,7 +6,7 @@
|
|
|
<div v-if="!isModifyMode" class="el-form-item">
|
|
|
<label class="el-form-item__label" style="width: 12%;">编号</label>
|
|
|
<div class="el-form-item__content" style="margin-left: 12%;">
|
|
|
- <div>{{project.code}}</div>
|
|
|
+ <div>{{projectId}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-form :model="project" :rules="rules" ref="project" label-width="12%" class="demo-project">
|
|
@@ -21,8 +21,8 @@
|
|
|
<span>联系人</span>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
- <el-input v-if="isModifyMode" v-model="project.contact.name" placeholder="请输入联系人姓名"></el-input>
|
|
|
- <div v-if="!isModifyMode">{{project.contact.name}}</div>
|
|
|
+ <el-input v-if="isModifyMode" v-model="project.contactName" placeholder="请输入联系人姓名"></el-input>
|
|
|
+ <div v-if="!isModifyMode">{{project.contactName}}</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="2">
|
|
@@ -32,27 +32,27 @@
|
|
|
<el-col :span="10">
|
|
|
<el-input
|
|
|
v-if="isModifyMode"
|
|
|
- v-model="project.contact.phone"
|
|
|
+ v-model="project.contactPhone"
|
|
|
placeholder="请输入联系人电话"
|
|
|
></el-input>
|
|
|
- <div v-if="!isModifyMode">{{project.contact.phone}}</div>
|
|
|
+ <div v-if="!isModifyMode">{{project.contactPhone}}</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="平台" prop="platform">
|
|
|
<el-checkbox-group v-if="isModifyMode" v-model="project.platform">
|
|
|
- <el-checkbox label="0">IOS</el-checkbox>
|
|
|
- <el-checkbox label="1">ANDROID</el-checkbox>
|
|
|
- <el-checkbox label="2">WEB</el-checkbox>
|
|
|
+ <el-checkbox label="IOS">IOS</el-checkbox>
|
|
|
+ <el-checkbox label="ANDROID">ANDROID</el-checkbox>
|
|
|
+ <el-checkbox label="WEB">WEB</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
<span
|
|
|
v-if="!isModifyMode"
|
|
|
- v-bind:class="['badge',{ 'ios-platform': item.toLowerCase()=='ios','android-platform': item.toLowerCase()=='android','web-platform': item.toLowerCase()=='web'}]"
|
|
|
- v-for="item in platformType"
|
|
|
+ class="badge"
|
|
|
+ v-for="item in project.platform"
|
|
|
>{{item}}</span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="需求描述" prop="desc">
|
|
|
+ <el-form-item label="需求描述">
|
|
|
<el-input v-if="isModifyMode" type="textarea" v-model="project.desc"></el-input>
|
|
|
<span v-if="!isModifyMode">{{project.desc}}</span>
|
|
|
</el-form-item>
|
|
@@ -65,31 +65,33 @@
|
|
|
|
|
|
<el-form-item label="服务类型" prop="type">
|
|
|
<el-checkbox-group v-if="isModifyMode" v-model="project.type">
|
|
|
- <el-checkbox label="接口测试" name="type"></el-checkbox>
|
|
|
- <el-checkbox label="安全漏洞扫描" name="type"></el-checkbox>
|
|
|
- <el-checkbox label="风险评估服务" name="type"></el-checkbox>
|
|
|
- <el-checkbox label="源代码安全审计服务" name="type"></el-checkbox>
|
|
|
- <el-checkbox label="功能测试服务" name="type"></el-checkbox>
|
|
|
- <el-checkbox label="性能测试" name="type"></el-checkbox>
|
|
|
- <el-checkbox label="功能和易用性测试" name="type"></el-checkbox>
|
|
|
+ <el-checkbox label="0" name="type">{{serviceType[0]}}</el-checkbox>
|
|
|
+ <el-checkbox label="1" name="type">{{serviceType[1]}}</el-checkbox>
|
|
|
+ <el-checkbox label="2" name="type">{{serviceType[2]}}</el-checkbox>
|
|
|
+ <el-checkbox label="3" name="type">{{serviceType[3]}}</el-checkbox>
|
|
|
+ <el-checkbox label="4" name="type">{{serviceType[4]}}</el-checkbox>
|
|
|
+ <el-checkbox label="5" name="type">{{serviceType[5]}}</el-checkbox>
|
|
|
+ <el-checkbox label="6" name="type">{{serviceType[6]}}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
- <span v-if="!isModifyMode" class="badge" v-for="item in project.type">{{item}}</span>
|
|
|
+ <span v-if="!isModifyMode" class="badge" v-for="item in project.type">{{serviceType[item]}}</span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="用途" prop="useage">
|
|
|
- <el-input v-if="isModifyMode" v-model="project.useage"></el-input>
|
|
|
- <span v-if="!isModifyMode">{{project.useage}}</span>
|
|
|
+ <el-form-item label="用途" prop="usage">
|
|
|
+ <el-input v-if="isModifyMode" v-model="project.usage"></el-input>
|
|
|
+ <span v-if="!isModifyMode">{{project.usage}}</span>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="预算" prop="budget">
|
|
|
<el-input v-if="isModifyMode" type="number" v-model="project.budget">
|
|
|
- <template slot="append">¥</template>
|
|
|
+ ¥
|
|
|
+ <template slot="append"></template>
|
|
|
</el-input>
|
|
|
<span v-if="!isModifyMode">{{project.budget}}¥</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="项目可见性" prop="resource">
|
|
|
<div v-if="!isModifyMode">
|
|
|
- <div v-if="project.resource=='定向'">{{project.institution}}</div>
|
|
|
- <div v-if="project.resource=='非定向'">{{project.resource}}</div>
|
|
|
+ <div v-if="project.resource=='1'">{{updateLocation(project.location)}}</div>
|
|
|
+ <div v-if="project.resource=='0'">{{project.institution}}</div>
|
|
|
+ <div v-if="project.resource=='2'">{{resourceType[project.resource]}}</div>
|
|
|
</div>
|
|
|
<el-tabs
|
|
|
:tab-position="tabPosition"
|
|
@@ -97,27 +99,41 @@
|
|
|
style="max-height: 200px;"
|
|
|
v-if="isModifyMode"
|
|
|
>
|
|
|
- <el-tab-pane label="定向" name="定向">
|
|
|
+ <el-tab-pane :label="resourceType[0]" name="0">
|
|
|
<el-radio-group v-model="project.institution">
|
|
|
<el-radio
|
|
|
:label="item"
|
|
|
name="type"
|
|
|
- v-for="item,index in institutionArray"
|
|
|
+ v-for="(item,index) in institutionArray"
|
|
|
:key="index"
|
|
|
></el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="非定向" name="非定向"></el-tab-pane>
|
|
|
+ <el-tab-pane :label="resourceType[1]" name="1">
|
|
|
+ <provincecity
|
|
|
+ ref="addFormProvince"
|
|
|
+ @selectChange="locationChange"
|
|
|
+ :provinceCode="project.location.provinceCode"
|
|
|
+ :cityCode="project.location.cityCode"
|
|
|
+ ></provincecity>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane :label="resourceType[2]" name="2"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="需求文档" prop="doc">
|
|
|
<el-upload
|
|
|
v-if="isModifyMode"
|
|
|
- class="upload-demo"
|
|
|
drag
|
|
|
- action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
- multiple
|
|
|
+ class="upload-demo"
|
|
|
+ action=""
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ :limit="1"
|
|
|
+ :on-exceed="handleExceed"
|
|
|
+ :before-upload="beforeFileUpload"
|
|
|
+ :http-request="uploadRequireDoc"
|
|
|
+ :file-list="project.doc"
|
|
|
>
|
|
|
<i class="el-icon-upload"></i>
|
|
|
<div class="el-upload__text">
|
|
@@ -126,16 +142,21 @@
|
|
|
</div>
|
|
|
<div class="el-upload__tip" slot="tip">请上传需求文档</div>
|
|
|
</el-upload>
|
|
|
- <span v-if="!isModifyMode">{{project.doc}}</span>
|
|
|
+ <span v-if="!isModifyMode"><a :href="project.requireDocUrl">{{project.requireDocUrl.split('/')[project.requireDocUrl.split('/').length-1]}}</a></span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="安装包" prop="file">
|
|
|
<el-upload
|
|
|
v-if="isModifyMode"
|
|
|
- class="upload-demo"
|
|
|
drag
|
|
|
- action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
- multiple
|
|
|
- :before-upload="beforeFileUpload"
|
|
|
+ class="upload-demo"
|
|
|
+ action=""
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ :limit="1"
|
|
|
+ :on-exceed="handleExceed"
|
|
|
+ :before-upload="beforeApkUpload"
|
|
|
+ :http-request="uploadApkFile"
|
|
|
+ :file-list="project.file"
|
|
|
>
|
|
|
<i class="el-icon-upload"></i>
|
|
|
<div class="el-upload__text">
|
|
@@ -144,7 +165,7 @@
|
|
|
</div>
|
|
|
<div class="el-upload__tip" slot="tip">只能上传Android或IOS安装包文件</div>
|
|
|
</el-upload>
|
|
|
- <span v-if="!isModifyMode">{{project.file}}</span>
|
|
|
+ <span v-if="!isModifyMode"><a :href="project.fileUrl">{{project.fileUrl.split('/')[project.fileUrl.split('/').length-1]}}</a></span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="项目截止时间" prop="datetime">
|
|
|
<div class="block" v-if="isModifyMode">
|
|
@@ -164,6 +185,8 @@
|
|
|
<div class="btn btn-medium" @click="cancelMode('project')">取消</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="!isModifyMode">
|
|
|
+ <div class="btn btn-medium btn-info" @click="submitProjectRequest()">提交项目</div>
|
|
|
+ <div class="btn btn-medium btn-info" @click="applyProject()">接受项目</div>
|
|
|
<div class="btn btn-medium btn-info" @click="modifyForm()">修改</div>
|
|
|
<div class="btn btn-medium btn-info" @click="analyseDemand()">分析需求</div>
|
|
|
<div class="btn btn-medium btn-info" @click="createTask()">新建任务</div>
|
|
@@ -209,11 +232,13 @@
|
|
|
<div
|
|
|
class="btn btn-small btn-info"
|
|
|
@click="handleAccept(scope.$index, scope.row.id)"
|
|
|
- >接受</div>
|
|
|
+ >接受
|
|
|
+ </div>
|
|
|
<div
|
|
|
class="btn btn-small btn-danger"
|
|
|
@click="handleReject(scope.$index, scope.row.id)"
|
|
|
- >拒绝</div>
|
|
|
+ >拒绝
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -223,19 +248,19 @@
|
|
|
<div class="create-body" v-if="!isModifyMode">
|
|
|
<div class="title h2">任务列表</div>
|
|
|
<div class="task-list">
|
|
|
- <el-table :showHeader="false" :data="project.task" style="width: 100%" max-height="400">
|
|
|
- <el-table-column prop="name" label="任务名称" title="任务名称"></el-table-column>
|
|
|
+ <el-table :showHeader="true" :stripe="true" :data="task" style="width: 100%">
|
|
|
+ <el-table-column prop="title" label="任务名称" title="任务名称"></el-table-column>
|
|
|
<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=='区域'">{{updateLocation(scope.row.location)}}</div>
|
|
|
- <div v-if="scope.row.resource=='定向'">{{scope.row.institution}}</div>
|
|
|
- <div v-if="scope.row.resource=='广场'">{{scope.row.resource}}</div>
|
|
|
+ <div v-if="scope.row.resource=='1'">{{updateLocation(scope.row.location)}}</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>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="type" label="业务类型">
|
|
|
<template slot-scope="scope">
|
|
|
- <div class="badge">{{scope.row.type}}</div>
|
|
|
+ <div class="badge">{{serviceType[scope.row.serviceType]}}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
@@ -244,11 +269,13 @@
|
|
|
<div
|
|
|
class="btn btn-small btn-info"
|
|
|
@click="goToTaskDetail(projectId, scope.row.id)"
|
|
|
- >查看详情</div>
|
|
|
+ >查看详情
|
|
|
+ </div>
|
|
|
<div
|
|
|
class="btn btn-small btn-danger"
|
|
|
@click="handleDelete(scope.$index, scope.row.id)"
|
|
|
- >删除</div>
|
|
|
+ >删除
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -257,389 +284,409 @@
|
|
|
|
|
|
<div class="create-body" v-if="!isModifyMode">
|
|
|
<div class="title h2">报告列表</div>
|
|
|
- <report-list/>
|
|
|
+ <report-list v-bind:reports="project.reportList" v-bind:taskId=null v-bind:projectId="projectId"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-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 Enum from '@/constants/enum/index'
|
|
|
+import PlatformType from '@/constants/enum/platform-type'
|
|
|
+import ReportList from '@/components/report/ReportList'
|
|
|
+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 ServiceType from '@/constants/enum/service-type'
|
|
|
+import {notify} from '@/constants/index'
|
|
|
+
|
|
|
export default {
|
|
|
- name: "Project",
|
|
|
- components: { ReportList },
|
|
|
- data() {
|
|
|
+ name: 'Project',
|
|
|
+ components: {
|
|
|
+ provincecity,
|
|
|
+ ReportList
|
|
|
+ },
|
|
|
+ data () {
|
|
|
var validatePass = (rule, value, callback) => {
|
|
|
- var reg = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
|
|
|
- if (value.phone) {
|
|
|
- if (!reg.test(value.phone)) {
|
|
|
- callback(new Error("请检查手机号码"));
|
|
|
+ var reg = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/
|
|
|
+ if (this.project.contactPhone) {
|
|
|
+ if (!reg.test(this.project.contactPhone)) {
|
|
|
+ callback(new Error('请检查手机号码'))
|
|
|
} else {
|
|
|
- callback();
|
|
|
+ callback()
|
|
|
}
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
return {
|
|
|
projectId: 0,
|
|
|
- tabPosition: "top",
|
|
|
+ tabPosition: 'top',
|
|
|
institutionArray: Enum.institution,
|
|
|
isModifyMode: false,
|
|
|
- platformType: [],
|
|
|
+ platformType: PlatformType,
|
|
|
+ resourceType: ResourceType,
|
|
|
+ serviceType: ServiceType,
|
|
|
project: {
|
|
|
- name: "项目名",
|
|
|
- code: "27382hdsjkfdskfK",
|
|
|
- contact: {
|
|
|
- name: "小王",
|
|
|
- phone: "12426177281"
|
|
|
- },
|
|
|
- type: ["安全漏洞扫描"],
|
|
|
- platform: ["0", "1"],
|
|
|
- desc: "需求描述文字",
|
|
|
- doc: "",
|
|
|
- file: "http://a.apk",
|
|
|
- resource: "非定向",
|
|
|
- institution: "",
|
|
|
- datetime: new Date("2018-11-11 23:11:11"),
|
|
|
- price: "400",
|
|
|
- useage: "练习",
|
|
|
- budget: "100",
|
|
|
- task: [
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- name: "任务1",
|
|
|
- desc: "任务描述文字",
|
|
|
- type: "安全漏洞扫描",
|
|
|
- resource: "广场",
|
|
|
- location: "",
|
|
|
- institution: "",
|
|
|
- datetime: "2018-11-12 11:11:01",
|
|
|
- worker: ""
|
|
|
- },
|
|
|
- {
|
|
|
- id: "2",
|
|
|
- name: "任务2",
|
|
|
- desc: "任务描述文字",
|
|
|
- type: "接口测试",
|
|
|
- resource: "定向",
|
|
|
- location: "",
|
|
|
- institution: "上软",
|
|
|
- datetime: "2018-11-11 10:11:01",
|
|
|
- worker: ""
|
|
|
- },
|
|
|
- {
|
|
|
- id: "3",
|
|
|
- name: "任务3",
|
|
|
- desc: "任务描述文字",
|
|
|
- type: "功能测试服务",
|
|
|
- resource: "区域",
|
|
|
- location: { provinceCode: "3200", cityCode: "3201" },
|
|
|
- institution: "",
|
|
|
- datetime: "2018-11-11 11:11:01",
|
|
|
- worker: ""
|
|
|
- }
|
|
|
- ]
|
|
|
+ userId: 0,
|
|
|
+ name: '',
|
|
|
+ type: '',
|
|
|
+ platform: '',
|
|
|
+ desc: '',
|
|
|
+ resource: '',
|
|
|
+ location: '',
|
|
|
+ institution: '',
|
|
|
+ contactName: '',
|
|
|
+ contactPhone: '',
|
|
|
+ doc: [],
|
|
|
+ requireDocUrl: '',
|
|
|
+ file: [],
|
|
|
+ fileUrl: '',
|
|
|
+ budget: '',
|
|
|
+ price: '',
|
|
|
+ datetime: '',
|
|
|
+ usage: '',
|
|
|
},
|
|
|
- analyseDemandList: [
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- institution: "上软",
|
|
|
- feasibilityReport: {
|
|
|
- name: "可行性分析报告",
|
|
|
- url: "feasibilityReport.docx"
|
|
|
- },
|
|
|
- priceAuditReport: { name: "价格审核告", url: "priceAuditReport.docx" }
|
|
|
- }
|
|
|
- ],
|
|
|
+ task: [],
|
|
|
+ analyseDemandList: [],
|
|
|
pickerOptions: {
|
|
|
shortcuts: [
|
|
|
{
|
|
|
- text: "今天",
|
|
|
- onClick(picker) {
|
|
|
- picker.$emit("pick", new Date());
|
|
|
+ text: '今天',
|
|
|
+ onClick (picker) {
|
|
|
+ picker.$emit('pick', new Date())
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- text: "昨天",
|
|
|
- onClick(picker) {
|
|
|
- const date = new Date();
|
|
|
- date.setTime(date.getTime() - 3600 * 1000 * 24);
|
|
|
- picker.$emit("pick", date);
|
|
|
+ text: '昨天',
|
|
|
+ onClick (picker) {
|
|
|
+ const date = new Date()
|
|
|
+ date.setTime(date.getTime() - 3600 * 1000 * 24)
|
|
|
+ picker.$emit('pick', date)
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- text: "一周前",
|
|
|
- onClick(picker) {
|
|
|
- const date = new Date();
|
|
|
- date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
- picker.$emit("pick", date);
|
|
|
+ text: '一周前',
|
|
|
+ onClick (picker) {
|
|
|
+ const date = new Date()
|
|
|
+ date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
|
|
|
+ picker.$emit('pick', date)
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
rules: {
|
|
|
name: [
|
|
|
- { required: true, message: "请输入项目名称", trigger: "blur" }
|
|
|
+ {required: true, message: '请输入项目名称', trigger: 'blur'}
|
|
|
// { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" }
|
|
|
],
|
|
|
type: [
|
|
|
{
|
|
|
- type: "array",
|
|
|
+ type: 'array',
|
|
|
required: true,
|
|
|
- message: "请至少选择一种服务类型",
|
|
|
- trigger: "change"
|
|
|
+ message: '请至少选择一种服务类型',
|
|
|
+ trigger: 'change'
|
|
|
}
|
|
|
],
|
|
|
platform: [
|
|
|
{
|
|
|
- type: "array",
|
|
|
+ type: 'array',
|
|
|
required: true,
|
|
|
- message: "请至少选择一个平台",
|
|
|
- trigger: "change"
|
|
|
+ message: '请至少选择一个平台',
|
|
|
+ trigger: 'change'
|
|
|
}
|
|
|
],
|
|
|
- desc: [{ required: true, message: "请填写活动形式", trigger: "blur" }],
|
|
|
- contact: [{ validator: validatePass, trigger: "blur" }],
|
|
|
+ desc: [{required: true, message: '请填写活动形式', trigger: 'blur'}],
|
|
|
+ contact: [{validator: validatePass, trigger: 'blur'}],
|
|
|
resource: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "请选择项目可见性",
|
|
|
- trigger: "change"
|
|
|
+ message: '请选择项目可见性',
|
|
|
+ trigger: 'change'
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
this.$nextTick(() => {
|
|
|
- this.init();
|
|
|
- });
|
|
|
+ this.init()
|
|
|
+ })
|
|
|
},
|
|
|
watch: {
|
|
|
- "project.resource"() {
|
|
|
- if (this.project.resource == "非定向") {
|
|
|
- this.project.institution = "";
|
|
|
+ '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 provinceCity.provinces) {
|
|
|
+ updateLocation (location) {
|
|
|
+ var provinceName = ''
|
|
|
+ var cityName = ''
|
|
|
+ for (var item of provinceCityJSON.provinces) {
|
|
|
if (item.code === location.provinceCode) {
|
|
|
- provinceName = item.name;
|
|
|
+ provinceName = item.name
|
|
|
for (var city of item.cities) {
|
|
|
if (city.code === location.cityCode) {
|
|
|
- cityName = city.name;
|
|
|
- break;
|
|
|
+ cityName = city.name
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return provinceName + " / " + cityName;
|
|
|
+ return provinceName + ' / ' + cityName
|
|
|
},
|
|
|
- init() {
|
|
|
- this.projectId = +this.$route.params.projectId;
|
|
|
- this.project.platform.map(item => {
|
|
|
- this.platformType.push(PlatformType[item]);
|
|
|
- });
|
|
|
+ init () {
|
|
|
+ this.projectId = this.$route.params.projectId
|
|
|
+ this.loadData()
|
|
|
+ // this.project.platform.map(item => {
|
|
|
+ // this.platformType.push(PlatformType[item])
|
|
|
+ // })
|
|
|
},
|
|
|
- submitForm(formName) {
|
|
|
- this.$refs[formName].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.isModifyMode = false;
|
|
|
- console.log(this.project);
|
|
|
- //提交 project
|
|
|
- } else {
|
|
|
- console.log("error submit!!");
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
+ //提交修改
|
|
|
+ submitForm (formName) {
|
|
|
+ //PROJ--2019073114009
|
|
|
+ const newProject = {
|
|
|
+ userId: 3,
|
|
|
+ name: this.project.name,
|
|
|
+ type: this.project.type,
|
|
|
+ platform: this.project.platform,
|
|
|
+ desc: this.project.desc,
|
|
|
+ resource: this.project.resource,
|
|
|
+ location: this.project.location,
|
|
|
+ institution: this.project.institution,
|
|
|
+ contactName: this.project.contactName,
|
|
|
+ contactPhone: this.project.contactPhone,
|
|
|
+ doc: this.project.requireDocUrl,
|
|
|
+ file: this.project.fileUrl,
|
|
|
+ budget: this.project.budget,
|
|
|
+ price: this.project.price,
|
|
|
+ datetime: this.project.datetime,
|
|
|
+ usage: this.project.usage,
|
|
|
+ }
|
|
|
+ console.log(newProject)
|
|
|
+ Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', this.projectId), newProject).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ this.isModifyMode = false
|
|
|
+ notify('success', '项目修改成功')
|
|
|
+ }).catch(error => {
|
|
|
+ notify('error', error.data.msg)
|
|
|
+ })
|
|
|
+ // this.$refs[formName].validate(valid => {
|
|
|
+ // if (valid) {
|
|
|
+ //
|
|
|
+ // //提交 project
|
|
|
+ // } else {
|
|
|
+ // console.log('error submit!!')
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
- resetForm(formName) {
|
|
|
- this.$refs[formName].resetFields();
|
|
|
- this.project.name = "";
|
|
|
- this.project.type = [];
|
|
|
- this.project.platform = [];
|
|
|
- this.project.desc = "";
|
|
|
- this.project.doc = "";
|
|
|
- this.project.file = "";
|
|
|
- this.project.contact = {
|
|
|
- name: "",
|
|
|
- phone: ""
|
|
|
- };
|
|
|
- this.project.resource = "非定向";
|
|
|
- this.project.institution = "";
|
|
|
- this.project.datetime = "";
|
|
|
- this.project.price = "";
|
|
|
- this.project.useage = "";
|
|
|
- this.project.budget = "";
|
|
|
+ //重置表单
|
|
|
+ resetForm (formName) {
|
|
|
+ this.$refs[formName].resetFields()
|
|
|
+ this.project.name = ''
|
|
|
+ this.project.type = []
|
|
|
+ this.project.platform = []
|
|
|
+ this.project.desc = ''
|
|
|
+ this.project.doc = ''
|
|
|
+ this.project.file = ''
|
|
|
+ this.project.contactName = ''
|
|
|
+ this.project.contactPhone = ''
|
|
|
+ this.project.resource = '2'
|
|
|
+ this.project.institution = ''
|
|
|
+ this.project.datetime = ''
|
|
|
+ this.project.price = ''
|
|
|
+ this.project.usage = ''
|
|
|
+ this.project.budget = ''
|
|
|
},
|
|
|
- modifyForm() {
|
|
|
- this.isModifyMode = true;
|
|
|
+ //进入修改项目页面
|
|
|
+ modifyForm () {
|
|
|
+ this.isModifyMode = true
|
|
|
+ this.project.type = []
|
|
|
+ this.project.platform = []
|
|
|
//获得update 信息
|
|
|
- this.project = {
|
|
|
- name: "项目名",
|
|
|
- code: "27382hdsjkfdskfK",
|
|
|
- contact: {
|
|
|
- name: "小王",
|
|
|
- phone: "13818022817"
|
|
|
- },
|
|
|
- type: ["安全漏洞扫描"],
|
|
|
- platform: ["0", "1"],
|
|
|
- desc: "需求描述文字",
|
|
|
- doc: "",
|
|
|
- file: "http://a.apk",
|
|
|
- resource: "非定向",
|
|
|
- institution: "",
|
|
|
- datetime: new Date("2018-11-11 23:11:11"),
|
|
|
- price: "400",
|
|
|
- useage: "练习",
|
|
|
- budget: "100",
|
|
|
- task: [
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- name: "任务1",
|
|
|
- desc: "任务描述文字",
|
|
|
- type: "安全漏洞扫描",
|
|
|
- resource: "广场",
|
|
|
- location: { provinceCode: "", cityCode: "" },
|
|
|
- institution: "",
|
|
|
- datetime: "2018-11-12 11:11:01",
|
|
|
- worker: ""
|
|
|
- },
|
|
|
- {
|
|
|
- id: "2",
|
|
|
- name: "任务2",
|
|
|
- desc: "任务描述文字",
|
|
|
- type: "接口测试",
|
|
|
- resource: "定向",
|
|
|
- location: { provinceCode: "", cityCode: "" },
|
|
|
- institution: "上软",
|
|
|
- datetime: "2018-11-11 10:11:01",
|
|
|
- worker: ""
|
|
|
- },
|
|
|
- {
|
|
|
- id: "3",
|
|
|
- name: "任务3",
|
|
|
- desc: "任务描述文字",
|
|
|
- type: "功能测试服务",
|
|
|
- resource: "区域",
|
|
|
- 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: "非定向",
|
|
|
- institution: "",
|
|
|
- datetime: new Date("2018-11-11 23:11:11"),
|
|
|
- price: "400",
|
|
|
- useage: "练习",
|
|
|
- budget: "100",
|
|
|
- task: [
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- name: "任务1",
|
|
|
- desc: "任务描述文字",
|
|
|
- type: "安全漏洞扫描",
|
|
|
- resource: "广场",
|
|
|
- location: "",
|
|
|
- institution: "",
|
|
|
- datetime: "2018-11-12 11:11:01",
|
|
|
- worker: ""
|
|
|
- },
|
|
|
- {
|
|
|
- id: "2",
|
|
|
- name: "任务2",
|
|
|
- desc: "任务描述文字",
|
|
|
- type: "接口测试",
|
|
|
- resource: "定向",
|
|
|
- location: "",
|
|
|
- institution: "上软",
|
|
|
- datetime: "2018-11-11 10:11:01",
|
|
|
- worker: ""
|
|
|
- },
|
|
|
- {
|
|
|
- id: "3",
|
|
|
- name: "任务3",
|
|
|
- desc: "任务描述文字",
|
|
|
- type: "功能测试服务",
|
|
|
- resource: "区域",
|
|
|
- location: { provinceCode: "3200", cityCode: "3201" },
|
|
|
- institution: "",
|
|
|
- datetime: "2018-11-11 11:11:01",
|
|
|
- worker: ""
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
+ //接收项目
|
|
|
+ submitProjectRequest () {
|
|
|
+ const data = {
|
|
|
+ userId: 3,
|
|
|
+ projectId: this.projectId
|
|
|
+ }
|
|
|
+ Http.post(Apis.USER.SUBMIT_PROJECT_REQUEST, data).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //申请项目
|
|
|
+ applyProject () {
|
|
|
+ const data = {
|
|
|
+ userId: 3,
|
|
|
+ projectId: this.projectId
|
|
|
+ }
|
|
|
+ Http.post(Apis.USER.ACCEPT_PROJECT, data).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancelMode (formName) {
|
|
|
+ this.isModifyMode = false
|
|
|
+ this.loadData()
|
|
|
+
|
|
|
},
|
|
|
- goToTaskDetail(id) {
|
|
|
+ goToTaskDetail (projectId, taskId) {
|
|
|
this.$router.push({
|
|
|
- name: "Task",
|
|
|
- params: { projectId: this.projectId, taskId: id }
|
|
|
- });
|
|
|
+ name: 'Task',
|
|
|
+ params: {projectId: projectId, taskId: taskId}
|
|
|
+ })
|
|
|
},
|
|
|
- createTask() {
|
|
|
- this.$router.push({ name: "TaskCreate" });
|
|
|
+ createTask () {
|
|
|
+ this.$router.push({name: 'TaskCreate'})
|
|
|
},
|
|
|
- createReport() {
|
|
|
- this.$router.push({ name: "ReportCreate" });
|
|
|
+ createReport () {
|
|
|
+ this.$router.push({
|
|
|
+ name: 'ReportCreate',
|
|
|
+ params: {
|
|
|
+ scope: 0,
|
|
|
+ dependencyCode: this.projectId,
|
|
|
+ projectId: this.projectId,
|
|
|
+ taskId: null,
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- handleDelete(index, id) {
|
|
|
- this.project.task.splice(index, 1);
|
|
|
+ handleDelete (index, id) {
|
|
|
+ this.task.splice(index, 1)
|
|
|
},
|
|
|
- beforeFileUpload(file) {
|
|
|
- const isAPK = file.type === "application/vnd.android.package-archive";
|
|
|
- const isDMG = file.type === "application/octet-stream";
|
|
|
+ beforeApkUpload (file) {
|
|
|
+ const isAPK = file.type === 'application/vnd.android.package-archive'
|
|
|
+ const isDMG = file.type === 'application/octet-stream'
|
|
|
|
|
|
if (!isAPK && !isDMG) {
|
|
|
- this.$message.error("上传安装包只能是 APK 或 DMG 格式!");
|
|
|
+ this.$message.error('上传安装包只能是 APK 或 DMG 格式!')
|
|
|
+ }
|
|
|
+ return isAPK || isDMG
|
|
|
+ },
|
|
|
+ beforeFileUpload (file) {
|
|
|
+ console.log(file)
|
|
|
+ const isPDF = file.type === 'application/pdf'
|
|
|
+ const isDOC = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
|
|
+ const isEXCEL = file.type === 'application/vnd.ms-excel'
|
|
|
+ const isXLS = file.type === 'application/x-xls'
|
|
|
+ const isTXT = file.type === 'text/plain'
|
|
|
+ const isXLSX = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
+ //console.log(file)
|
|
|
+ if (!(isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX)) {
|
|
|
+ this.$message.error('上传文件只能是 PDF 、 DOC 、DOCX 、XLS、TXT、XLSX 格式!')
|
|
|
+ }
|
|
|
+ return isDOC || isEXCEL || isPDF || isTXT || isXLS || isXLSX
|
|
|
+ },
|
|
|
+ analyseDemand () {
|
|
|
+ this.$router.push({name: 'AnalyseDemand'})
|
|
|
+ },
|
|
|
+ handleAccept (index, id) {
|
|
|
+ console.log('接受')
|
|
|
+ },
|
|
|
+ handleReject (index, id) {
|
|
|
+ console.log('拒绝')
|
|
|
+ },
|
|
|
+ loadData () {//PROJ--2019073114009
|
|
|
+ Http.get(Apis.PROJECT.GET_PROJECT.replace('{projectId}', this.projectId)).then((res) => {
|
|
|
+ //console.log(res)
|
|
|
+ this.projectId = res.projectDetails.id
|
|
|
+ this.project.name = res.projectDetails.name
|
|
|
+ this.project.contactName = res.projectDetails.contactName
|
|
|
+ this.project.contactPhone = res.projectDetails.contactPhone
|
|
|
+ this.project.type = res.projectDetails.type
|
|
|
+ this.project.platform = res.projectDetails.platform
|
|
|
+ this.project.desc = res.projectDetails.desc
|
|
|
+ this.project.doc = []
|
|
|
+ this.project.file = []
|
|
|
+ this.project.resource = res.projectDetails.resource
|
|
|
+ this.project.location = res.projectDetails.location
|
|
|
+ this.project.institution = res.projectDetails.institution
|
|
|
+ this.project.datetime = new Date(res.projectDetails.datetime)
|
|
|
+ this.project.price = res.projectDetails.price
|
|
|
+ this.project.budget = res.projectDetails.budget
|
|
|
+ this.project.usage = res.projectDetails.usage
|
|
|
+ this.project.fileUrl = res.projectDetails.file
|
|
|
+ this.project.requireDocUrl = res.projectDetails.doc
|
|
|
+
|
|
|
+ this.task = res.taskList
|
|
|
+ this.analyseDemandList = res.reportList
|
|
|
+ })
|
|
|
+ },
|
|
|
+ locationChange (provinceId, cityId) {
|
|
|
+ if (provinceId || cityId) {
|
|
|
+ this.project.location = {provinceCode: provinceId, cityCode: cityId}
|
|
|
}
|
|
|
- return isAPK && isDMG;
|
|
|
},
|
|
|
- analyseDemand() {
|
|
|
- this.$router.push({ name: "AnalyseDemand" });
|
|
|
+ handleRemove (file, fileList) {
|
|
|
+ console.log(file, fileList)
|
|
|
},
|
|
|
- handleAccept(index, id) {
|
|
|
- console.log("接受");
|
|
|
+ handleExceed (files, fileList) {
|
|
|
+ this.$message.warning(
|
|
|
+ `当前限制选择 1 个文件,本次选择了 ${
|
|
|
+ files.length
|
|
|
+ } 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
|
|
+ )
|
|
|
},
|
|
|
- handleReject(index, id) {
|
|
|
- console.log("拒绝");
|
|
|
+ beforeRemove (file, fileList) {
|
|
|
+ //return this.$confirm(`确定移除 ${file.name}?`)
|
|
|
+ },
|
|
|
+ uploadRequireDoc (param) {
|
|
|
+ const formData = new FormData()
|
|
|
+ let config = {
|
|
|
+ //添加请求头
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'},
|
|
|
+ }
|
|
|
+ formData.append('file', param.file)
|
|
|
+ Http.upload(Apis.FILE.REQUIREMENT_FILE.replace('{userId}', 3), formData, config).then((res) => {
|
|
|
+ console.log('上传成功')
|
|
|
+ this.project.requireDocUrl = res.data
|
|
|
+ console.log(res.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ uploadApkFile (param) {
|
|
|
+ const formData = new FormData()
|
|
|
+ let config = {
|
|
|
+ //添加请求头
|
|
|
+ headers: {'Content-Type': 'multipart/form-data'},
|
|
|
+ }
|
|
|
+ formData.append('file', param.file)
|
|
|
+ Http.upload(Apis.FILE.APK.replace('{userId}', 3), formData, config).then((res) => {
|
|
|
+ console.log('上传成功')
|
|
|
+ this.project.fileUrl = res.data
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
-.task-list {
|
|
|
- margin: 0 30px;
|
|
|
-}
|
|
|
-.el-col {
|
|
|
- padding: 0 !important;
|
|
|
-}
|
|
|
-.el-row {
|
|
|
- margin-bottom: 10px;
|
|
|
-}
|
|
|
+ .task-list {
|
|
|
+ margin: 0 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-col {
|
|
|
+ padding: 0 !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-row {
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
</style>
|
|
|
|