|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<section>
|
|
<section>
|
|
- <!--工具条-->
|
|
|
|
|
|
+ <!--工具条-->
|
|
<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
<el-form :inline="true">
|
|
<el-form :inline="true">
|
|
<el-form-item style="float:right;">
|
|
<el-form-item style="float:right;">
|
|
@@ -13,6 +13,7 @@
|
|
<el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
<el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
|
|
<el-table-column type="index" width="60"></el-table-column>
|
|
<el-table-column type="index" width="60"></el-table-column>
|
|
<el-table-column prop="projectName" label="项目名称" sortable></el-table-column>
|
|
<el-table-column prop="projectName" label="项目名称" sortable></el-table-column>
|
|
|
|
+ <el-table-column prop="userNames" label="参与者" sortable></el-table-column>
|
|
<el-table-column label="操作" width="220">
|
|
<el-table-column label="操作" width="220">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<!-- <el-button size="small" type="primary" @click="detail(scope.$index)">详情</el-button> -->
|
|
<!-- <el-button size="small" type="primary" @click="detail(scope.$index)">详情</el-button> -->
|
|
@@ -36,11 +37,16 @@
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<!--新增界面-->
|
|
<!--新增界面-->
|
|
- <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth">
|
|
|
|
|
|
+ <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
|
|
<el-form ref="form1" :model="addForm" :rules="rules" label-width="100px">
|
|
<el-form ref="form1" :model="addForm" :rules="rules" label-width="100px">
|
|
<el-form-item label="项目名称" prop="name">
|
|
<el-form-item label="项目名称" prop="name">
|
|
<el-input v-model="addForm.name" placeholder="请输入项目名称" clearable></el-input>
|
|
<el-input v-model="addForm.name" placeholder="请输入项目名称" clearable></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="参与者">
|
|
|
|
+ <el-select v-model="addForm.userId" multiple filterable placeholder="请选择参与者" style="width:100%;">
|
|
|
|
+ <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click.native="addFormVisible = false">取消</el-button>
|
|
<el-button @click.native="addFormVisible = false">取消</el-button>
|
|
@@ -59,6 +65,7 @@
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
|
|
|
|
date: new Date(),
|
|
date: new Date(),
|
|
|
|
+ users: [],
|
|
|
|
|
|
tableHeight: 0,
|
|
tableHeight: 0,
|
|
listLoading: false,
|
|
listLoading: false,
|
|
@@ -72,6 +79,7 @@
|
|
title: "",
|
|
title: "",
|
|
addForm: {
|
|
addForm: {
|
|
name: '',
|
|
name: '',
|
|
|
|
+ userId: [],
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
name: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
|
|
name: [{ required: true, message: "请输入项目名称", trigger: "blur" }],
|
|
@@ -79,6 +87,30 @@
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ getUsers() {
|
|
|
|
+ this.http.post(this.port.manage.list, {
|
|
|
|
+ departmentId: -1,
|
|
|
|
+ pageIndex: 1,
|
|
|
|
+ pageSize: 99999
|
|
|
|
+ },
|
|
|
|
+ res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.users = res.data.records;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
//分页
|
|
//分页
|
|
handleCurrentChange(val) {
|
|
handleCurrentChange(val) {
|
|
this.page = val;
|
|
this.page = val;
|
|
@@ -100,7 +132,19 @@
|
|
res => {
|
|
res => {
|
|
this.listLoading = false;
|
|
this.listLoading = false;
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
- this.list = res.data.records;
|
|
|
|
|
|
+ var list = res.data.records;
|
|
|
|
+ for(var i in list) {
|
|
|
|
+ var participator = list[i].participator , str = "";
|
|
|
|
+ for(var j in participator) {
|
|
|
|
+ if(j == participator.length-1) {
|
|
|
|
+ str += participator[j].name
|
|
|
|
+ } else {
|
|
|
|
+ str += participator[j].name + ','
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ list[i].userNames = str;
|
|
|
|
+ }
|
|
|
|
+ this.list = list;
|
|
this.total = res.data.total;
|
|
this.total = res.data.total;
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
@@ -123,13 +167,19 @@
|
|
if(i == -1) {
|
|
if(i == -1) {
|
|
this.title = "新增项目";
|
|
this.title = "新增项目";
|
|
this.addForm = {
|
|
this.addForm = {
|
|
- name: ''
|
|
|
|
|
|
+ name: '',
|
|
|
|
+ userId: [],
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.title = "修改项目";
|
|
this.title = "修改项目";
|
|
|
|
+ var list = this.list[i].participator , arr = [];
|
|
|
|
+ for(var j in list) {
|
|
|
|
+ arr.push(list[j].id)
|
|
|
|
+ }
|
|
this.addForm = {
|
|
this.addForm = {
|
|
id: this.list[i].id,
|
|
id: this.list[i].id,
|
|
- name: this.list[i].projectName
|
|
|
|
|
|
+ name: this.list[i].projectName,
|
|
|
|
+ userId: arr
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.addFormVisible = true;
|
|
this.addFormVisible = true;
|
|
@@ -139,7 +189,17 @@
|
|
this.$refs.form1.validate(valid => {
|
|
this.$refs.form1.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
this.addLoading = true;
|
|
this.addLoading = true;
|
|
- this.http.post(this.port.project.add,this.addForm,
|
|
|
|
|
|
+ let formData = new FormData();
|
|
|
|
+ formData.append("name", this.addForm.name);
|
|
|
|
+ if(this.addForm.id != null) {
|
|
|
|
+ formData.append("id", this.addForm.id);
|
|
|
|
+ }
|
|
|
|
+ if(this.addForm.userId.length != 0) {
|
|
|
|
+ for(var j in this.addForm.userId) {
|
|
|
|
+ formData.append("userId", this.addForm.userId[j]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.http.uploadFile(this.port.project.add,formData,
|
|
res => {
|
|
res => {
|
|
this.addLoading = false;
|
|
this.addLoading = false;
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
@@ -220,6 +280,7 @@
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.getList();
|
|
this.getList();
|
|
|
|
+ this.getUsers();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|