|
@@ -176,6 +176,7 @@
|
|
|
<el-button size="small" @click="batchSetWudulistBtn1">取消</el-button>
|
|
|
<el-button size="small" type="primary" @click="batchSetWudulistBtn2(true)">批量设置{{user.timeType.customDegreeName}}</el-button>
|
|
|
<el-button size="small" type="primary" @click="batchSetWudulistBtn2(false)">批量添加{{user.timeType.customDegreeName}}</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="addGroupPerson()" :loading="addGroupPersonBtnLoading">批量添加分组参与人</el-button>
|
|
|
</template>
|
|
|
<el-pagination
|
|
|
@size-change="handleSizeChange"
|
|
@@ -505,7 +506,7 @@
|
|
|
</el-input>
|
|
|
<el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
|
|
|
ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="addForm.userId"
|
|
|
- highlight-current :filter-node-method="filterNode" default-expand-all></el-tree>
|
|
|
+ highlight-current :filter-node-method="filterNode"></el-tree>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
<div>已选中 {{chosenMembCount}} 人</div>
|
|
@@ -563,6 +564,7 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 批量修改自定义维度 -->
|
|
|
<el-dialog :title="checkoradd ? '批量修改' : '批量添加'" :visible.sync="checkedWuduDialog" v-if="checkedWuduDialog" width="40%">
|
|
|
<el-form model="" label-width="20%">
|
|
|
<el-form-item :label="'设置' + user.timeType.customDegreeName">
|
|
@@ -577,6 +579,49 @@
|
|
|
<el-button type="primary" @click="batchSetWudulistBtn4" v-if="!checkoradd">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 批量添加参与人 -->
|
|
|
+ <el-dialog title="批量添加参与人" v-if="addGroupPersonDialog" :visible.sync="addGroupPersonDialog" width="40%">
|
|
|
+ <el-form label-width="20%">
|
|
|
+ <el-form-item label="选择人员">
|
|
|
+ <el-tooltip placement="top" effect="light">
|
|
|
+ <div slot="content" style="width:450px">{{addGroupPersonData.personNames}}</div>
|
|
|
+ <el-input @focus="addGroupPersonP" v-model="addGroupPersonData.personNames"></el-input>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="选择分组">
|
|
|
+ <el-select v-model="addGroupPersonData.group" multiple placeholder="请选择分组" style="width:100%">
|
|
|
+ <el-option v-for="item in addGroupList"
|
|
|
+ :key="item.groupIds"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.groupIds"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="addGroupPersonDialog = false" >取消</el-button>
|
|
|
+ <el-button type="primary" @click="addGroupPersonSure()" >确定</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog append-to-body title="选择人员" v-if="addGroupPersonPdialog" :visible.sync="addGroupPersonPdialog" width="40%">
|
|
|
+ <div class="tree" style="height:300px">
|
|
|
+ <el-scrollbar style="height:100%">
|
|
|
+ <el-input
|
|
|
+ placeholder="输入关键字进行过滤"
|
|
|
+ v-model="filterText2">
|
|
|
+ </el-input>
|
|
|
+ <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
|
|
|
+ ref="chooseMembTree2" @check-change="addPersonCheck"
|
|
|
+ highlight-current :filter-node-method="filterNode" :default-checked-keys="addGroupPersonData.person"></el-tree>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <div>已选中 {{chosenMembCount}} 人</div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="addGroupPersonPdialog = false" >取消</el-button>
|
|
|
+ <el-button type="primary" @click="addPersonSure()" >确定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </el-dialog>
|
|
|
</section>
|
|
|
</template>
|
|
|
<style scoped>
|
|
@@ -693,6 +738,7 @@ a {
|
|
|
auseList: [],
|
|
|
yonghuUser: [],
|
|
|
filterText: '',
|
|
|
+ filterText2: '',
|
|
|
showClfDialog: false,
|
|
|
addClfDialog:false,
|
|
|
addClf:{name:'',id:''},
|
|
@@ -702,7 +748,17 @@ a {
|
|
|
checkedProjectArr: [],
|
|
|
checkedWuduDialog: false,
|
|
|
checkedWuduArr: [],
|
|
|
- checkoradd: true
|
|
|
+ checkoradd: true,
|
|
|
+
|
|
|
+ addGroupPersonBtnLoading: false,
|
|
|
+ addGroupPersonDialog: false,
|
|
|
+ addGroupList: [],
|
|
|
+ addGroupPersonData: {
|
|
|
+ group: [],
|
|
|
+ person: null,
|
|
|
+ personNames: ''
|
|
|
+ },
|
|
|
+ addGroupPersonPdialog: false
|
|
|
};
|
|
|
},
|
|
|
// 过滤器
|
|
@@ -729,6 +785,9 @@ a {
|
|
|
watch: {
|
|
|
filterText(val) {
|
|
|
this.$refs.chooseMembTree.filter(val);
|
|
|
+ },
|
|
|
+ filterText2(val) {
|
|
|
+ this.$refs.chooseMembTree2.filter(val);
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -739,7 +798,12 @@ a {
|
|
|
},
|
|
|
batchSetWudulistBtn1(){
|
|
|
this.$refs.projectlistOfWudulist.clearSelection()
|
|
|
- this.checkedWuduArr = []
|
|
|
+ this.checkedWuduArr = [],
|
|
|
+ this.addGroupPersonData = {
|
|
|
+ group: null,
|
|
|
+ person: null,
|
|
|
+ personNames: ''
|
|
|
+ }
|
|
|
},
|
|
|
batchSetWudulistBtn2(e){
|
|
|
if(this.checkedProjectArr.length == 0){
|
|
@@ -833,6 +897,103 @@ a {
|
|
|
},
|
|
|
|
|
|
|
|
|
+ test(){
|
|
|
+ console.log(this.addGroupPersonData.group);
|
|
|
+ },
|
|
|
+ // 批量添加参与人员
|
|
|
+ addGroupPerson(){
|
|
|
+ let proArr = []
|
|
|
+ if(this.checkedProjectArr.length == 0){
|
|
|
+ this.$message('请选择项目')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.addGroupPersonBtnLoading = true
|
|
|
+ for(let i=0;i<this.checkedProjectArr.length;i++){
|
|
|
+ proArr.push(this.checkedProjectArr[i].id)
|
|
|
+ }
|
|
|
+ this.http.post('/project/getProjectsGroups',{
|
|
|
+ projectIdArray: JSON.stringify(proArr)
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ console.log('分组',res.data);
|
|
|
+ this.addGroupList = res.data
|
|
|
+ this.addGroupPersonBtnLoading = false
|
|
|
+ this.addGroupPersonDialog = true
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },err => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ addGroupPersonP(){
|
|
|
+ this.filterText2 = ''
|
|
|
+ this.addGroupPersonPdialog = true
|
|
|
+ },
|
|
|
+ addPersonCheck(){
|
|
|
+ var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
|
|
|
+ var list = chosenList.filter(item=>item.isUser == 1);
|
|
|
+ this.chosenMembCount = list.length;
|
|
|
+ console.log(list);
|
|
|
+ },
|
|
|
+ addPersonSure(){
|
|
|
+ this.addGroupPersonPdialog = false
|
|
|
+ let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
|
|
|
+ let list = chosenList.filter(item=>item.isUser == 1);
|
|
|
+ let listIDs = []
|
|
|
+ let listNames = ''
|
|
|
+ for(let i=0;i<list.length;i++){
|
|
|
+ listIDs.push(list[i].id)
|
|
|
+ listNames += list[i].label + ','
|
|
|
+ }
|
|
|
+ this.addGroupPersonData.person = listIDs
|
|
|
+ this.addGroupPersonData.personNames = listNames
|
|
|
+ },
|
|
|
+ addGroupPersonSure(){
|
|
|
+ if(this.addGroupPersonData.group.length == 0 || this.addGroupPersonData.person == null){
|
|
|
+ this.$message({
|
|
|
+ message: '请选择人员/分组',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let groupList = []
|
|
|
+ for(let i=0;i<this.addGroupPersonData.group.length;i++){
|
|
|
+ groupList = [...groupList,...this.addGroupPersonData.group[i]]
|
|
|
+ }
|
|
|
+ this.http.post('/project/batchAddMembToGroup',{
|
|
|
+ membIdArray: JSON.stringify(this.addGroupPersonData.person),
|
|
|
+ groupIds: JSON.stringify(groupList)
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.addGroupPersonDialog = false,
|
|
|
+
|
|
|
+ this.batchSetWudulistBtn1()
|
|
|
+ this.$message({
|
|
|
+ message: '添加成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },err => {
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
filterNode(value, data) {
|
|
|
if (!value) return true;
|
|
@@ -1244,6 +1405,7 @@ a {
|
|
|
showChooseMembTree() {
|
|
|
this.chosenMembCount = this.participator.length;
|
|
|
this.chooseParticipVisible = true;
|
|
|
+ this.filterText = ''
|
|
|
},
|
|
|
onTreeItemChange() {
|
|
|
var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
|