|
@@ -47,9 +47,13 @@
|
|
|
<el-dropdown-item divided @click.native="editIncharger(item)">
|
|
|
<i class="el-icon-user"></i>
|
|
|
设负责人</el-dropdown-item>
|
|
|
+ <el-dropdown-item divided @click.native="setupParticipants(item)">
|
|
|
+ <i class="iconfont firerock-iconusers"></i>
|
|
|
+ 设参与人</el-dropdown-item>
|
|
|
<el-dropdown-item divided @click.native="deleteGroup(item)">
|
|
|
<i class="el-icon-delete"></i>
|
|
|
删除分组</el-dropdown-item>
|
|
|
+ <!-- 设置参与人 0000 -->
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</div>
|
|
@@ -248,7 +252,31 @@
|
|
|
<el-tab-pane label="数据统计" name="summary"><Summary ref="summary"></Summary></el-tab-pane>
|
|
|
<el-tab-pane label="挣值分析" name="earning" v-if="user.id == currentProject.creator || user.id == currentProject.incharger_id ||permissions.projectBaseline"><Earning ref="earning"></Earning></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 设置参与人员界面 -->
|
|
|
+ <el-dialog title="选择参与人员" v-if="participantsDialog" :visible.sync="participantsDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
+ <div class="tree" style="height:400px">
|
|
|
+ <el-scrollbar style="height:100%">
|
|
|
+ <el-input
|
|
|
+ placeholder="输入关键字进行过滤"
|
|
|
+ v-model="participantsFilterText">
|
|
|
+ </el-input>
|
|
|
+ <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
|
|
|
+ ref="chooseMembTree2" @check-change="onTreeItemChange" :default-checked-keys="alreadyPartArray"
|
|
|
+ highlight-current :filter-node-method="filterNode" default-expand-all></el-tree>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <div>已选中 {{chosenMembCount}} 人</div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="participantsDialog = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="setParticipants()">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
<!--新增任务界面-->
|
|
|
<el-dialog :class="addForm.id==null?'':'jm'" :title="title" v-if="addFormVisible" :visible.sync="addFormVisible"
|
|
|
:close-on-click-modal="false" customClass="customWidth" width="800px" ref="addDialog">
|
|
@@ -985,16 +1013,134 @@ import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
|
|
|
taskFileList:[],
|
|
|
relationFileDialog: false,
|
|
|
addFileId: null,
|
|
|
- isEditFile: false
|
|
|
+ isEditFile: false,
|
|
|
+
|
|
|
+ // 设置项目参与人
|
|
|
+ participantsDialog: false,
|
|
|
+ participantsFilterText: '',
|
|
|
+ deptMembData: [
|
|
|
+ {
|
|
|
+ id: 0,
|
|
|
+ label: '未分配',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ defaultProps: {
|
|
|
+ children: 'children',
|
|
|
+ label: 'label'
|
|
|
+ },
|
|
|
+ chosenMembCount: 0,
|
|
|
+ ididid:null,
|
|
|
+ alreadyPartArray: []
|
|
|
};
|
|
|
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ participantsFilterText(val) {
|
|
|
+ this.$refs.chooseMembTree2.filter(val);
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
- // 0011
|
|
|
- // test(){
|
|
|
- // // console.log("test",this.addFileId);
|
|
|
- // this.getTaskFileList()
|
|
|
- // },
|
|
|
+ setParticipants(){
|
|
|
+ let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
|
|
|
+ let chose2 = chosenList.filter(item=>item.isUser == 1)
|
|
|
+ let chose3 = []
|
|
|
+ for(let i=0;i<chose2.length;i++){chose3.push(chose2[i].id)}
|
|
|
+ console.log('test',chose2,chose3);
|
|
|
+ this.http.post('/group-participator/save',{
|
|
|
+ groupId: this.ididid,
|
|
|
+ idsJson: JSON.stringify(chose3)
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+
|
|
|
+ }else {
|
|
|
+
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 设置项目参与人
|
|
|
+ setupParticipants(item){
|
|
|
+ this.ididid = item.id
|
|
|
+ console.log(item);
|
|
|
+ this.participantsDialog = true
|
|
|
+ this.getAlreadyPartArray(item.id)
|
|
|
+ this.getDepartmentList()
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ // 获取用于设置参与人的列表
|
|
|
+ getDepartmentList(){
|
|
|
+ this.http.post('/department/listAllMemb',{
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ let list = res.data
|
|
|
+ this.haveUsersList(list)
|
|
|
+ this.deptMembData = JSON.parse(JSON.stringify(list))
|
|
|
+ console.log('123',this.deptMembData);
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },haveUsersList(list){
|
|
|
+ for (var i in list) {
|
|
|
+ if (list[i].children != null) {
|
|
|
+ this.haveUsersList(list[i].children);
|
|
|
+ }
|
|
|
+ if (list[i].userList != null) {
|
|
|
+ if (list[i].children == null) {
|
|
|
+ list[i].children = [];
|
|
|
+ }
|
|
|
+ list[i].userList.forEach(element => {
|
|
|
+ var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
|
|
|
+ list[i].children.push(obj);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取已参与人员
|
|
|
+ getAlreadyPartArray(eid){
|
|
|
+ this.http.post('/group-participator/get',{
|
|
|
+ groupId: eid
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.alreadyPartArray = res.data
|
|
|
+ // console.log('get',res.data, this.alreadyPartArray)
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 筛选逻辑
|
|
|
+ filterNode(value, data) {
|
|
|
+ if (!value) return true;
|
|
|
+ return data.label.indexOf(value) !== -1;
|
|
|
+ },
|
|
|
+ // 选中改变
|
|
|
+ onTreeItemChange() {
|
|
|
+ var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
|
|
|
+ var list = chosenList.filter(item=>item.isUser == 1);
|
|
|
+ this.chosenMembCount = list.length;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 关联文件按钮
|
|
|
relationFileClick(){
|
|
|
this.relationFileDialog = true
|