提交 480a9aa7 authored 作者: zax's avatar zax

项目新增

上级 13a6472b
......@@ -158,3 +158,36 @@
font-size: 18px;
font-family: 'Regular';
}
/*checkbox选择款*/
.el-checkbox__input.is-disabled .el-checkbox__inner,.el-checkbox__input.is-checked .el-checkbox__inner{
width: 21px;
height: 21px;
background-image: url("../assets/img/click.png");
background-repeat: no-repeat;
background-size: 100% 100%;
-moz-background-size: 100% 100%;
background-color: rgba(0,0,0,0);
border-color: rgba(0,0,0,0);
}
.el-checkbox__inner{
width: 21px;
height: 21px;
background-image: url("../assets/img/clickN.png");
background-repeat: no-repeat;
background-size: 100% 100%;
-moz-background-size: 100% 100%;
background-color: rgba(0,0,0,0);
border-color: rgba(0,0,0,0);
}
.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner,.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after{
background-color: rgba(0,0,0,0);
border-color: rgba(0,0,0,0);
}
.el-checkbox__input.is-checked .el-checkbox__inner::after{
display: none;
}
.el-checkbox__label,.el-checkbox__input.is-checked + .el-checkbox__label,.el-checkbox__input.is-disabled + span.el-checkbox__label{
color: #333333;
font-size: 18px;
vertical-align: middle;
}
......@@ -41,7 +41,17 @@
label="操作"
align="center">
<template >
<span class="change">下载</span>
<span class="button buttonSave buttonHandle">下载</span>
<span class="button buttonSave buttonHandle">
上传
<el-upload
style="margin-top: -43px;"
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:before-upload="uploadFile">
<el-button size="small" type="primary"></el-button>
</el-upload>
</span>
</template>
</el-table-column>
</el-table>
......@@ -52,7 +62,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-size="pagesize"
:page-size="pageSize"
background
layout="prev, pager, next"
:total="totleLength">
......@@ -71,13 +81,27 @@ export default {
data () {
return {
searchVal: '',
allData: [],
allData: [{name:'1',roleName: '123',unitName: '1',number: '1'}],
currentPage: 1, // 分页第一页
pagesize: 7, // 每页个数
pageSize: 8, // 每页个数
totleLength: 0, // 获取后台传的所有数据的长度
}
},
mounted() {
this.search();
},
methods: {
// 查询
search () {
let data = {
page: this.currentPage,
pageSize: this.pageSize,
t: {}
}
this.$server.postFileSearch(data).then(res => {
console.log(res)
})
},
// 点击分页
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
......@@ -86,12 +110,13 @@ export default {
handleCurrentChange(val) {
// console.log(`当前页: ${val}`);
this.currentPage = val;
}
},
uploadFile(file) {}
}
}
</script>
<style scoped>
<style>
.document{
width: 100%;
height: 841px;
......@@ -111,4 +136,28 @@ export default {
.document .content .button {
margin-left: 12px;
}
.document .content .buttonHandle{
width: 50px;
display: initial;
}
/*上传按钮*/
.document .content>>>.el-button--small{
font-size: 18px;
}
.document .content>>>.el-button--primary{
background-color: rgba(0,0,0,0);
border-color: rgba(0,0,0,0);
margin-left: 62px;
width: 39px;
}
.el-checkbox__input.is-checked{
background: url('./img/click.png');
}
.document .content>>> .el-checkbox__inner{
background: url('./img/clickN.png') !important;
}
.document .el-checkbox__input.is-disabled + span.el-checkbox__label{
color: #333333 !important;
font-size: 18px;
}
</style>
......@@ -184,7 +184,7 @@
label="类型"
align="center">
<template slot-scope="scope">
<el-select v-model="scope.row.form" @change="typeVal($event)" placeholder="请选择" clearable>
<el-select v-model="scope.row.form" placeholder="请选择" clearable>
<el-option
v-for="item in formList"
:key="item.id"
......@@ -222,17 +222,12 @@
prop="name"
label="里程碑编号"
align="center">
<template slot-scope="scope">
<span>{{scope.row.name}}</span>
</template>
</el-table-column>
<el-table-column
:formatter="typeChange"
prop="type"
label="里程碑名称"
align="center">
<template slot-scope="scope">
<span>{{scope.row.type}}</span>
</template>
</el-table-column>
<el-table-column
prop="startTime"
......@@ -252,14 +247,17 @@
label="文件列表"
align="center">
<template slot-scope="scope">
<el-checkbox-group v-if="scope.row.type === '需求确认'" v-model="scope.row.files">
<el-checkbox v-for="item in globalOne" :label="item"></el-checkbox>
<el-checkbox-group v-if="scope.row.name === '里程碑1'" v-model="checkVal1">
<el-checkbox label="需求文档"></el-checkbox>
<el-checkbox label="详细设计"></el-checkbox>
<el-checkbox label="开工令" disabled></el-checkbox>
</el-checkbox-group>
<el-checkbox-group v-if="scope.row.type === '初验'" v-model="scope.row.files">
<el-checkbox v-for="item in globalTwo" :label="item"></el-checkbox>
<el-checkbox-group v-if="scope.row.name === '里程碑2'" v-model="checkVal2">
<el-checkbox label="初验报告" disabled></el-checkbox>
</el-checkbox-group>
<el-checkbox-group v-if="scope.row.type === '终验'" v-model="scope.row.files">
<el-checkbox v-for="item in globalThree" :label="item"></el-checkbox>
<el-checkbox-group v-if="scope.row.name === '里程碑3'" v-model="checkVal3">
<el-checkbox label="试运行报告"></el-checkbox>
<el-checkbox label="终验报告" disabled></el-checkbox>
</el-checkbox-group>
</template>
</el-table-column>
......@@ -299,13 +297,15 @@ export default {
softwareData: [{name: '',des: '',startTime: '',endTime: ''}],
productData: [{name: '',model: '',form: '',expect: '1'}],
milepostData: [
{name: '里程碑1',type: '需求确认',time: '', files: []},
{name: '里程碑2',type: '初验',time: '', files: []},
{name: '里程碑3',type: '终验',time: '', files: []},
{name: '里程碑1',type: 1,endTime: '', files: []},
{name: '里程碑2',type: 2,endTime: '', files: []},
{name: '里程碑3',type: 3,endTime: '', files: []},
],
globalOne: ['需求文档', '详细设计', '开工令'],
globalTwo: ['初验报告'],
globalThree: ['试运行报告','终验报告'],
typeVal: {
'1': '需求确认',
'2': '初验',
'3': '终验',
},
textarea: '',
addImg: require('./img/add.png'),
addSelect: require('./img/add-select.png'),
......@@ -331,7 +331,10 @@ export default {
build: '',
integrate: '',
develop: '',
supervisor: ''
supervisor: '',
checkVal1: ['开工令'],
checkVal2: ['初验报告'],
checkVal3: ['终验报告']
}
},
mounted() {
......@@ -364,8 +367,39 @@ export default {
});
})
},
// 里程碑文件列表转换
milepostChange() {
this.milepostData.map(item => { // 里程碑文件列表
let arr = [];
let data = {
name: ''
};
if (item.type === 1) {
this.checkVal1.forEach(res => {
data.name = res;
arr.push(data);
})
}
if (item.type === 2) {
this.checkVal2.forEach(res => {
data.name = res;
arr.push(data);
})
}
if (item.type === 3) {
this.checkVal3.forEach(res => {
data.name = res;
arr.push(data);
})
}
arr.map(data => {
item.files.push(data);
})
})
},
// 确定新增项目
save () {
this.milepostChange(); // 里程碑数据
let changeProduct = {
'服务器': 1,
'CPU': 2,
......@@ -377,15 +411,6 @@ export default {
this.productData.map(item => { // 产品类型转换
item.form = changeProduct[item.form]
})
let changeGoals = {
'需求确认': 1,
'初验': 2,
'终验': 3,
}
this.milepostData.map(item => { // 里程碑编号转换
item.type = changeGoals[item.type]
})
console.log(this.milepostData)
let techId = '';
this.techList.map(item => { // 技术路线id
if (item.name === this.techVal) {
......@@ -416,19 +441,26 @@ export default {
thirdId = item.id
}
})
this.softwareData.map(item => { // 软件信息时间转换
item.startTime = new Date(item.startTime).getTime();
item.endTime = new Date(item.endTime).getTime();
})
this.milepostData.map(item => { // 里程碑时间转换
item.endTime = new Date(item.endTime).getTime();
})
let data = {
consId: consId,
consName: this.build,
devId: devId,
devName: this.develop,
endTime: this.endTime,
endTime: new Date(this.endTime).getTime(),
goals: this.milepostData,
gratorId: gratorId,
gratorName: this.integrate,
hardwares: this.productData,
name: this.name,
softWorks: this.softwareData,
startTime: this.startTime,
startTime: new Date(this.startTime).getTime(),
techId: techId,
techName: this.techVal,
thirdId: thirdId,
......@@ -437,6 +469,14 @@ export default {
console.log(data)
this.$server.postProjectAdd(data).then(res => {
console.log(res)
if (res.data.code === 200) {
this.$message.success('项目新增成功!');
this.$router.push({name: 'projectManagement'});
} else {
this.$message.error('项目新增失败!');
}
}).catch(err => {
this.$message.error('项目新增失败!');
})
},
// 技术路线查询产品信息
......@@ -452,9 +492,6 @@ export default {
})
}
},
typeVal(e) {
this.type = e.target.value
},
// 软件信息新增
addSoftware() {
let data = {name: '',des: '',startTime: '',endTime: ''};
......@@ -468,6 +505,10 @@ export default {
addProduct() {
let data = {name: '',model: '',form: '',expect: '1'};
this.productData.push(data);
},
// 里程碑名称转换
typeChange(val) {
return this.typeVal[val.type];
}
}
}
......
......@@ -79,10 +79,10 @@
</el-col>
</el-row>
</div>
</template>
</template>
<script>
export default {
<script>
export default {
data () {
return {
searchVal: '',
......
......@@ -210,6 +210,12 @@ const server = {
method: 'post',
data: data
})
},
postFileSearch(data) { // 项目管理文件清单分页查询
return axios('/file/search', {
method: 'post',
data: data
})
}
}
export default server;
import Vue from 'vue'
import { Row, Col, Carousel, CarouselItem, Scrollbar, Input, Button, Table, TableColumn, Pagination, Dialog,
Message,Select, Option, Form, FormItem, Radio, RadioGroup, Upload, DatePicker,Checkbox} from 'element-ui'
Message,Select, Option, Form, FormItem, Radio, RadioGroup, Upload, DatePicker,Checkbox,CheckboxGroup} from 'element-ui'
import './element-variables.scss'
Vue.use(Row);
Vue.use(Col);
......@@ -27,3 +27,4 @@ Vue.use(RadioGroup);
Vue.use(Upload);
Vue.use(DatePicker);
Vue.use(Checkbox);
Vue.use(CheckboxGroup);
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论