|
@@ -3,20 +3,10 @@
|
|
|
<!-- 顶部导航栏 -->
|
|
|
<el-header class="main-header">
|
|
|
<div class="select-group">
|
|
|
- <el-cascader ref="cascader" v-model="teamNames" :options="options" class="cascader" @change="handleChange" />
|
|
|
- <span class="el-dropdown-link" @click="setCascader">{{ teamBizName.length > 11 ? teamBizName.substring(0, 11) + '...' : teamBizName }} <i class="el-icon-arrow-down" /></span>
|
|
|
- <el-dropdown size="small" style="margin-left: 20px" @command="handleBizId">
|
|
|
- <span class="el-dropdown-link">
|
|
|
- {{ bizName }}<i class="el-icon-arrow-down el-icon--right" />
|
|
|
- </span>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item
|
|
|
- v-for="item in searchEnum.businesslines"
|
|
|
- :key="item.code"
|
|
|
- :command="item.code"
|
|
|
- >{{ item.name }}</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
+ <el-cascader ref="cascader" v-model="teamNames" collapse-tags :options="options" :props="props" class="cascader" @change="handleChange(teamNames, options)" />
|
|
|
+ <span class="el-dropdown-link" style="margin-right: 20px;" @click="setCascader">{{ teamBizName.length > 11 ? teamBizName.substring(0, 11) + '...' : teamBizName }} <i class="el-icon-arrow-down" /></span>
|
|
|
+ <el-cascader ref="cascader" v-model="bizIdCode" collapse-tags :options="searchEnum.businesslines" :props="propsBizId" class="cascader" @change="handleBizIdChange(bizIdCode, searchEnum.businesslines)" />
|
|
|
+ <span class="el-dropdown-link" @click="setCascader">{{ bizName.length > 11 ? bizName.substring(0, 11) + '...' : bizName }} <i class="el-icon-arrow-down" /></span>
|
|
|
</div>
|
|
|
<div class="top-tabs">
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
@@ -42,7 +32,7 @@
|
|
|
<el-tab-pane label="列表视图" name="3" />
|
|
|
<el-tab-pane label="甘特图" name="2" />
|
|
|
</el-tabs>
|
|
|
- <list-view v-show="activeSchedule === '3'" :type="'团队'" :biz="bizId" />
|
|
|
+ <list-view v-show="activeSchedule === '3'" :type="'团队'" :biz="searchForm" />
|
|
|
<search-section
|
|
|
v-show="activeSchedule === '1'"
|
|
|
ref="search-section"
|
|
@@ -253,12 +243,20 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
value: [],
|
|
|
+ props: { multiple: true },
|
|
|
+ propsBizId: {
|
|
|
+ multiple: true,
|
|
|
+ value: 'code',
|
|
|
+ label: 'name',
|
|
|
+ children: 'children'
|
|
|
+ },
|
|
|
options: [],
|
|
|
activeName: '1', // 顶部导航栏
|
|
|
activeSchedule: '1', // 日历和甘特图切换
|
|
|
+ optionData: [],
|
|
|
searchForm: {
|
|
|
- teamId: null,
|
|
|
- bizId: null
|
|
|
+ teamIds: [],
|
|
|
+ bizIds: []
|
|
|
},
|
|
|
searchEnum: {
|
|
|
businesslines: []
|
|
@@ -266,6 +264,7 @@ export default {
|
|
|
dialog_team_visible: false, // 删除日程弹窗
|
|
|
// teamName: '团队', // 团队名字
|
|
|
teamNames: [],
|
|
|
+ bizIdCode: [-1],
|
|
|
teamBizName: '团队',
|
|
|
bizName: '业务线', // 业务线名字
|
|
|
filtrate: {// 筛选区域
|
|
@@ -281,6 +280,8 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
loading: true,
|
|
|
+ bizCode: 0,
|
|
|
+ teamCode: 0,
|
|
|
calendarView: null, // 日程图表数据
|
|
|
showDetail: false, // 显示详情弹框
|
|
|
nowDetailData: {}, // 当前选中日程的数据
|
|
@@ -296,6 +297,7 @@ export default {
|
|
|
visible: false,
|
|
|
data: null
|
|
|
},
|
|
|
+ datas: [],
|
|
|
DialogTitle: '新建排期', // 排期弹框标题
|
|
|
isDelete: false, // 删除排期操作
|
|
|
visibleSchedule: false, // 排期任务弹框
|
|
@@ -339,32 +341,142 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.queryTeamInfoList()
|
|
|
+ this.queryTeamInfoList([-1])
|
|
|
this.teamReminding()
|
|
|
},
|
|
|
methods: {
|
|
|
setCascader() {
|
|
|
this.$refs.cascader.$el.click()
|
|
|
},
|
|
|
- handleChange(val) {
|
|
|
- let a = ''
|
|
|
- let b = ''
|
|
|
- this.options.map(item => {
|
|
|
- if (item.value === val[0]) {
|
|
|
- a = item.label
|
|
|
+ handleBizIdChange(val, option) {
|
|
|
+ if (val.length > 0) {
|
|
|
+ const one = val[0]
|
|
|
+ const tow = val[1] || ''
|
|
|
+ let [name, nameTow] = ['', '']
|
|
|
+ option.map(item => {
|
|
|
+ this.optionData.push(item.code)
|
|
|
+ if (one[0] !== -1 && item.code === one[0]) name = item.name
|
|
|
+ if (val[1] && item.code === tow[0]) nameTow = item.name
|
|
|
+ })
|
|
|
+ if (this.bizCode === 0 && one[0] === -1) { // 默认全选
|
|
|
+ this.bizName = '业务线'
|
|
|
+ this.bizIdCode = this.optionData
|
|
|
+ this.bizCode = 1
|
|
|
+ } else {
|
|
|
+ if (one[0] !== -1 && this.bizCode === 1) { // 取消全选
|
|
|
+ this.bizIdCode = null
|
|
|
+ this.bizName = '业务线'
|
|
|
+ this.bizCode = 0
|
|
|
+ } else if (one[0] === -1 && val.length < option.length) { // 点击全选以外的,取消全选
|
|
|
+ const data = val.filter(item => { return item[0] })
|
|
|
+ data.splice(0, 1)
|
|
|
+ this.bizIdCode = data
|
|
|
+ this.bizName = (name ? name + '/' : '') + (nameTow ? '' + nameTow : '')
|
|
|
+ this.bizCode = 0
|
|
|
+ } else if (one[0] !== -1 && val.length === (option.length - 1)) { // 点击其余的全部,触发全选
|
|
|
+ const data = val.filter(item => { return item[0] })
|
|
|
+ data.unshift([-1])
|
|
|
+ this.bizIdCode = data
|
|
|
+ this.bizName = '业务线'
|
|
|
+ this.bizCode = 1
|
|
|
+ } else if (one[0] !== -1) { // 基础多选
|
|
|
+ const data = val.filter(item => { return item[0] })
|
|
|
+ this.bizIdCode = data
|
|
|
+ this.bizName = name + (nameTow ? '/' + nameTow : '')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.bizIdCode && this.bizIdCode.length > 0) {
|
|
|
+ const arr = this.bizIdCode.map(value => { return value[0] })
|
|
|
+ if (arr[0] === undefined) {
|
|
|
+ this.handleBizId([-1])
|
|
|
+ } else {
|
|
|
+ this.handleBizId(arr)
|
|
|
+ }
|
|
|
}
|
|
|
- if (item.children) {
|
|
|
- item.children.map(item => {
|
|
|
- if (item.value === val[1]) {
|
|
|
- b = item.label
|
|
|
+ } else {
|
|
|
+ this.bizIdCode = [-1]
|
|
|
+ this.bizName = '业务线'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleChange(val, options) {
|
|
|
+ if (val.length > 0) {
|
|
|
+ let [a, b, stop] = ['', '', true]
|
|
|
+ val.map(e => {
|
|
|
+ this.options.map(item => {
|
|
|
+ if (item.value === e[0]) a = item.label
|
|
|
+ if (item.children && stop) {
|
|
|
+ item.children.map(item => {
|
|
|
+ this.searchForm.teamIds.push(item.value)
|
|
|
+ if (item.value === e[1]) {
|
|
|
+ b = item.label
|
|
|
+ stop = false
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
+ })
|
|
|
+ const arr = val[0]
|
|
|
+ if (this.teamCode === 0 && arr[0] === -1) { // 默认全选
|
|
|
+ this.teamNames = this.datas
|
|
|
+ this.teamBizName = '团队'
|
|
|
+ this.teamCode = 1
|
|
|
+ this.bizName = '业务线'
|
|
|
+ this.bizIdCode = this.optionData
|
|
|
+ } else if (arr[0] !== -1 && this.teamCode === 1) {
|
|
|
+ this.teamNames = null
|
|
|
+ this.teamBizName = '团队'
|
|
|
+ this.bizName = '业务线'
|
|
|
+ this.teamCode = 0
|
|
|
+ this.bizIdCode = null
|
|
|
+ } else {
|
|
|
+ if (arr[0] === -1 && val.length < this.datas.length) {
|
|
|
+ const data = val.filter(item => { return item[0] })
|
|
|
+ data.splice(0, 1)
|
|
|
+ this.teamBizName = a + (b ? ' / ' + b : '')
|
|
|
+ this.teamNames = data
|
|
|
+ this.teamCode = 0
|
|
|
+ this.bizName = '业务线'
|
|
|
+ const datas = data.map(item => { return item[0] })
|
|
|
+ const bizIds = Array.from(new Set(datas))
|
|
|
+ this.bizIdCode = bizIds
|
|
|
+ this.bizCode = 0
|
|
|
+ } else if (arr[0] !== -1 && val.length === (this.datas.length - 1)) {
|
|
|
+ const data = val.filter(item => { return item[0] })
|
|
|
+ data.unshift([-1])
|
|
|
+ this.teamBizName = '团队'
|
|
|
+ this.teamNames = data
|
|
|
+ this.teamCode = 1
|
|
|
+ this.bizName = '业务线'
|
|
|
+ this.bizIdCode = this.optionData
|
|
|
+ } else if (arr[0] !== -1) {
|
|
|
+ this.teamNames = val
|
|
|
+ this.teamBizName = a + (b ? ' / ' + b : '')
|
|
|
+ const datas = val.map(item => { return item[0] })
|
|
|
+ const bizIds = Array.from(new Set(datas))
|
|
|
+ this.bizIdCode = bizIds
|
|
|
+ let [name, nameTow] = ['', '']
|
|
|
+ this.searchEnum.businesslines.map(item => {
|
|
|
+ if (item.code === bizIds[0]) name = item.name
|
|
|
+ if (bizIds[1] && item.code === bizIds[1]) nameTow = item.name
|
|
|
+ })
|
|
|
+ this.bizName = name + (nameTow ? '/' + nameTow : '')
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
- this.searchForm.teamId = val[1]
|
|
|
- this.searchForm.bizId = val[0]
|
|
|
- this.bizName = a
|
|
|
- this.teamBizName = a + (b ? ' / ' + b : '')
|
|
|
+ this.searchForm.bizIds = this.bizIdCode
|
|
|
+ this.handleBizId(this.searchForm.bizIds)
|
|
|
+ const teamNum = []
|
|
|
+ this.teamNames.map(s => {
|
|
|
+ if (s[0] === -1) {
|
|
|
+ this.searchForm.teamIds = [-1]
|
|
|
+ } else {
|
|
|
+ teamNum.push(s[1])
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.searchForm.teamIds = Array.from(new Set(teamNum))
|
|
|
+ } else {
|
|
|
+ this.teamBizName = '团队'
|
|
|
+ this.bizName = '业务线'
|
|
|
+ }
|
|
|
},
|
|
|
handleClick() {
|
|
|
if (this.activeName === '5' && this.$refs.bugTableDialog) {
|
|
@@ -390,30 +502,40 @@ export default {
|
|
|
label: item.bizName,
|
|
|
children: item.teamInfos ? this.setTeamChildren(item.teamInfos) : null
|
|
|
}))
|
|
|
+ this.options[0].value = -1
|
|
|
+ this.datas = []
|
|
|
+ this.options.map(item => {
|
|
|
+ if (item.children) {
|
|
|
+ item.children.map(i => {
|
|
|
+ this.datas.push([item.value, i.value])
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.datas.push([item.value])
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.handleChange(this.datas, this.options)
|
|
|
}
|
|
|
const res = await settingGetBizList({})
|
|
|
if (res.code === 200 && res.data) {
|
|
|
this.searchEnum.businesslines = res.data.filter(item => item.isSecret === 0)
|
|
|
- this.searchEnum.businesslines.unshift({ code: null, name: '全部' })
|
|
|
+ this.searchEnum.businesslines.unshift({ code: -1, name: '全部' })
|
|
|
+ this.handleBizIdChange([[-1]], this.searchEnum.businesslines)
|
|
|
}
|
|
|
},
|
|
|
setTeamChildren(data) {
|
|
|
const arr = data.map(item => ({ value: item.code, label: item.name }))
|
|
|
return arr
|
|
|
},
|
|
|
- async queryTeamInfoList() { // 获取用户团队列表
|
|
|
- const res = await queryTeamInfoList({ curIndex: 1, pageSize: 9999, type: 0, bizId: this.searchForm.bizId })
|
|
|
+ async queryTeamInfoList(e) { // 获取用户团队列表
|
|
|
+ const res = await queryTeamInfoList({ curIndex: 1, pageSize: 9999, type: 0, bizIds: e })
|
|
|
if (res.code === 200 && res.data) {
|
|
|
this.searchEnum.teams = res.data.list
|
|
|
this.searchEnum.teams.unshift({ teamId: null, teamName: '全部团队' })
|
|
|
}
|
|
|
},
|
|
|
handleBizId(e) { // 业务线变动
|
|
|
- this.searchForm.bizId = e
|
|
|
- this.queryTeamInfoList()// 重新获取团队
|
|
|
- const res = this.searchEnum.businesslines.find(item => item.code === e)
|
|
|
- this.bizName = res.name
|
|
|
- // this.$store.dispatch('global/setBizId', res.code)
|
|
|
+ this.searchForm.bizIds = e
|
|
|
+ this.queryTeamInfoList(this.searchForm.bizIds)// 重新获取团队
|
|
|
this.handleClick()
|
|
|
},
|
|
|
showSchedule(e) { // 查看日程详情
|
|
@@ -730,12 +852,15 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
.cascader {
|
|
|
position: absolute;
|
|
|
- width: 20px;
|
|
|
+ width: 7%;
|
|
|
/deep/.el-input__inner {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
/deep/.el-input__icon {
|
|
|
display: none;
|
|
|
-}
|
|
|
+ }
|
|
|
+ /deep/.el-cascader__tags .el-tag {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|