wenbobowen 4 năm trước cách đây
mục cha
commit
89a9082372

+ 8 - 0
src/api/workSchedule.js

@@ -286,3 +286,11 @@ export function getStaffByUsername(name) {
     method: 'get'
   })
 }
+
+// 通过id获取组织架构
+export function getStaffByDeptId(deptId) {
+  return request({
+    url: teamWorkbenchUrl + `/api/department/getDeptArch?deptId=${deptId}`,
+    method: 'get'
+  })
+}

+ 3 - 10
src/components/searchHeader/searchForm.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="searchForm">
+  <div class="searchForm" :style="styles">
     <div v-for="l in data" :key="l.key" class="Layout" style="display: inline-flex;padding-left: 15px; width:270px;" :style="l.styles">
       <div class="name" :style="l.nameStyles">{{ l.name }}</div>
       <el-select
@@ -121,7 +121,7 @@
         tree-default-expand-all
         :tree-checkable="l.treeCheckable"
         :tree-data="l.option"
-        @change="(e) => test(l, e)"
+        @change="(e) => $emit('change', l.key, e || '')"
       />
       <el-input
         v-else
@@ -149,7 +149,7 @@ export default {
     loading: {
       type: Boolean,
       default: false,
-      required: true
+      required: false
     },
     styles: {
       type: Object,
@@ -204,14 +204,9 @@ export default {
     }
   },
   mounted() {
-    console.log()
     this.setDate(this.showItemDataPickerItem, 'showItemDataPicker')
   },
   methods: {
-    test(l, v) {
-      console.log(v || '')
-      this.$emit('change', l.key, v || '')
-    },
     setDate(type, key) { // 日期筛选
       let startDate = null
       let endDate = null
@@ -232,13 +227,11 @@ export default {
           // this.bugCountTimeType = this.timeTypeList[2].code
           break
       }
-      console.log(startDate, endDate)
       this.showItemDataPickerItem = type
       this.data.map(g => {
         // data[g.key] = g.value
         if (g.type === key) g.value = [startDate, endDate]
       })
-      console.log(startDate, endDate)
       this.showItemDataPickerStratAndEnd = [startDate, endDate]
       this.$emit('change', key, [startDate, endDate])
     }

+ 14 - 10
src/views/dataBigManage/components/qualityModule/index.vue

@@ -404,7 +404,10 @@ export default {
     },
     // 移动端发布质量数据
     getMobilePublishQualityList() {
-      const { hotpacth, addIssue } = this.datas.mobilePublishQualityList
+      const {
+        hotpacth
+        // addIssue // 增发
+      } = this.datas.mobilePublishQualityList
       return [
         {
           'innerColor': '#3F9DFE',
@@ -414,16 +417,17 @@ export default {
           'title': hotpacth.countStr,
           'titleUnit': '次',
           'IdList': hotpacth.IdList
-        },
-        {
-          'innerColor': '#F5222D',
-          'outColor': '#F5DDE2',
-          'padding': '8px 0px',
-          'label': addIssue.label,
-          'title': addIssue.countStr,
-          'titleUnit': '次',
-          'IdList': addIssue.IdList
         }
+        // 增发次数暂时隐藏
+        // {
+        //   'innerColor': '#F5222D',
+        //   'outColor': '#F5DDE2',
+        //   'padding': '8px 0px',
+        //   'label': addIssue.label,
+        //   'title': addIssue.countStr,
+        //   'titleUnit': '次',
+        //   'IdList': addIssue.IdList
+        // }
       ]
     },
     changeList() {}

+ 464 - 10
src/views/dataBigManage/index.vue

@@ -1,14 +1,39 @@
 <template>
   <div class="page-wrap data-big-wrapper" style="min-width: 1320px" @click="openDrawer=false">
     <div class="page-header detial">
-      <searchHeader
+      <!-- <searchHeader
         :is-mt5="false"
         :data="listSearch"
         :is-hidden-time="true"
         @search="search"
         @moreReset="moreReset"
         @changeShowMore="changeShowMore"
-      />
+      /> -->
+      <div class="select-group teamDrop">
+        <el-dropdown placement="top-start" trigger="click">
+          <span class="el-dropdown-link">
+          {{ departmentName && departmentName.length > 6 ? departmentName.substring(0, 11) + '...' : departmentName }}
+          <i class="el-icon-arrow-down el-icon--right" />
+          </span>
+          <el-dropdown-menu slot="dropdown" class="dropTeam">
+            <div class="team-val">组织结构</div>
+            <div class="deptCodesClass">
+              <el-cascader-panel v-model="params.deptCodes" :props="{ multiple: true }" :options="department" @change="changeArchitecture" />
+            </div>
+            <div class="team-val">自定义团队</div>
+            <el-cascader-panel v-model="teamData.teamNames" :props="{ multiple: true }" :options="options" @change="changeTeam" />
+          </el-dropdown-menu>
+        </el-dropdown>
+        <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" style="margin: 0 20px;" @click="setCascader">{{ bizName.length > 11 ? bizName.substring(0, 11) + '...' : bizName }} <i class="el-icon-arrow-down" /></span>
+        <div style="margin-left: 30px; display: inline-block">
+          <searchForm
+            :data="searchFormList"
+            :styles="{ display: 'inline-block' }"
+            @change="dateChange"
+          />
+        </div>
+      </div>
     </div>
     <div class="page-content detial">
       <header class="header mb10">
@@ -43,8 +68,6 @@
       />
     </div>
     <div>
-<!--      <drawer-modal v-if="openDrawer" :drawer="openDrawer" :data="requireList" />-->
-<!--      <el-button @click="openDrawer = true">触发</el-button>-->
       <drawer-modal
         :open-drawer.sync="openDrawer"
         :drawer-data="requireList"
@@ -74,10 +97,14 @@ import {
   getEfficiencyDataRequest
 } from '@/api/dataMarket'
 import {
+  // queryTeamInfoList,
+  getStaffByDeptId,
+  settingQueryBizAndTeamInfo,
   getStaffByUsername
 } from '@/api/workSchedule'
+import { settingGetBizList } from '@/api/defectManage'
 import { teamQueryTeamInfoList } from '@/api/configure'
-import searchHeader from '@/components/searchHeader'
+import searchForm from '@/components/searchHeader/searchForm'
 import headTitle from '@/components/headTitle'
 import throughputModule from './components/throughputModule/index.vue'
 import qualityModule from './components/qualityModule/index.vue'
@@ -85,7 +112,7 @@ import efficiencyModule from './components/efficiencyModule/index.vue'
 import drawerModal from './components/drawerModal/index.vue'
 export default {
   components: {
-    searchHeader,
+    searchForm,
     headTitle,
     throughputModule,
     qualityModule,
@@ -95,6 +122,17 @@ export default {
   data() {
     return {
       // enum
+      searchFormList: [{
+        name: '时间',
+        value: '',
+        key: 'time',
+        valueFormat: 'yyyy-MM-dd HH:mm:ss',
+        type: 'showItemDataPicker',
+        placeholder: '请选择时间',
+        boxStyles: { display: 'inline-block' },
+        styles: { minWidth: '270px', width: 'auto' },
+        nameStyles: { minWidth: '53px', lineHeight: '32px' }
+      }],
       listSearch: listSearchData,
       showMore: false,
       openDrawer: false,
@@ -105,7 +143,10 @@ export default {
         onlineProblemViweType: '日期',
         wholeTab: '需求',
         verTab: '青桔端',
-        requirementBacklogType: '研发积压'
+        requirementBacklogType: '研发积压',
+        teamIds: [],
+        bizIds: [],
+        deptCodes: []
       },
       mainData: {
         quality: {},
@@ -118,15 +159,258 @@ export default {
       throughputLoading: false,
       throughputListLoading: false,
       throughputBacklogLoading: false,
-      efficiencyLoading: false
+      efficiencyLoading: false,
+      // 自定义团队
+      // searchForm: {
+      //   teamIds: [],
+      //   bizIds: [],
+      //   deptCodes: []
+      // },
+      teamData: { // 筛选团队
+        teamBizName: '团队',
+        teamNames: [],
+        teamCode: 0
+      },
+      departmentName: '团队',
+      department: [],
+      departmentData: [],
+      options: [],
+      depdObj: [],
+      searchEnum: {
+        businesslines: []
+      },
+      bizIdCode: [],
+      propsBizId: {
+        multiple: true,
+        value: 'code',
+        label: 'name',
+        children: 'children'
+      },
+      bizName: '业务线', // 业务线名字
+      optionData: [],
+      bizCode: 0
     }
   },
+  created() {
+    this.getProvence()
+    this.settingGetBizList()
+  },
   mounted() {
     // this.init()
     // localStorage.getItem('username')
-    this.getSearchOptios()
+    // this.getSearchOptios()
   },
   methods: {
+    // 业务线与团队架构互斥
+    paramsReset(type) {
+      // bizIds=[-1000] 业务线全不选
+      // deptCodes 为[] 清空
+      // teamIds 为[] 清空 同时 teamData.teamNames 也要为空
+      const { bizIds, deptCodes, teamIds } = this.params
+      if (type === '业务线') {
+        if (bizIds[0] !== -1000) {
+          // 业务线有值
+          this.params = {
+            ...this.params,
+            deptCodes: [],
+            teamIds: []
+          }
+          this.teamData = { // 筛选团队
+            teamBizName: '团队',
+            teamNames: [],
+            teamCode: 0
+          }
+          this.departmentName = '团队'
+        }
+      } else if (type === '团队') {
+        // 如果团队和组织有选择项, 则业务线清空
+        if (deptCodes.length > 0 || teamIds.length > 0) {
+          this.params = {
+            ...this.params,
+            bizIds: [-1000]
+          }
+          this.bizIdCode = []
+          this.bizName = '业务线'
+        }
+      }
+    },
+    dateChange(e, date) {
+      console.log('sssss')
+      this.params = {
+        ...this.params,
+        startTime: date[0],
+        endTime: date[1]
+      }
+      this.getList()
+      console.log('e', e, date, this.params)
+    },
+    setCascader() {
+      this.$refs.cascader.$el.click()
+    },
+    // 组织团队
+    changeArchitecture(command) { // 组织架构名称
+      console.log(command, this.depdObj, '组织架构')
+      // this.departmentName = this.depdObj[command[command.length - 1]]
+      this.departmentName = this.department[0].label
+      this.paramsReset('团队')
+      console.log('params', this.params)
+    },
+    changeTeam(command) {
+      if (command.length > 0) {
+        let [a, b, stop] = ['', '', true]
+        command.map(e => {
+          this.options.map(item => {
+            if (item.value === e[0]) a = item.label
+            if (item.children && stop) {
+              item.children.map(item => {
+                // this.params.teamIds.push(item.value)
+                if (item.value === e[1]) {
+                  b = item.label
+                  stop = false
+                }
+              })
+            }
+          })
+        })
+        const arr = command[0]
+        if (this.teamData.teamCode === 0 && arr[0] === -1) { // 默认全选
+          this.teamData = { teamBizName: '团队', teamNames: [...this.datas], teamCode: 1 }
+          const list = this.datas.slice(1)
+          this.params.teamIds = list.map(item => { return item[1] })
+        } else if (arr[0] !== -1 && this.teamData.teamCode === 1) {
+          this.teamData = { teamBizName: '团队', teamNames: null, teamCode: 0 }
+          this.params.teamIds = []
+        } else {
+          if (arr[0] === -1 && command.length < this.datas.length) { // 点击全部以外,取消全选
+            const data = command.filter(item => { return item[0] })
+            data.splice(0, 1)
+            this.teamData = { teamBizName: a + (b ? ' / ' + b : ''), teamNames: data, teamCode: 0 }
+            this.params.teamIds = data.map(item => { return item[1] })
+          } else if (arr[0] !== -1 && command.length === (this.datas.length - 1)) { // 点击全部,触发全选
+            const data = command.filter(item => { return item[0] })
+            data.unshift([-1])
+            this.teamData = { teamBizName: '团队', teamNames: data, teamCode: 1 }
+            const list = this.datas.slice(1)
+            this.params.teamIds = list.map(item => { return item[1] })
+          } else if (arr[0] !== -1) { // 基础多选
+            this.teamData.teamNames = command
+            const data = command.map(i => { return i[1] })
+            this.teamData.teamBizName = a + (b ? ' / ' + b : '')
+            this.params.teamIds = data
+          }
+        }
+      } else {
+        this.params.teamIds = []
+        this.teamData = { teamBizName: '团队' }
+      }
+      this.paramsReset('团队')
+      this.getList()
+      console.log(this.params, this.teamData)
+    },
+    async settingGetBizList() { // 获取业务线
+      const res1 = await settingQueryBizAndTeamInfo()
+      if (res1.code === 200) {
+        this.options = res1.data.map(item => ({
+          value: item.bizId,
+          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])
+          }
+        })
+      }
+      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: -1, name: '全部' })
+        this.handleBizIdChange([], this.searchEnum.businesslines)
+      }
+    },
+    getProvence() { // 获取组织架构
+      getStaffByDeptId('107420').then(res => {
+        if (res.code === 200 && res.data) {
+          this.depdShow = true
+          this.department = [res.data]
+          // this.params= {
+          //   ...this.params,
+          //   deptCodes: [["107420", "107423", "150893", "107822"]]
+          // }
+          this.$nextTick(() => {
+            document.getElementsByClassName('deptCodesClass')[0]
+              .querySelectorAll('li:first-child')[0]
+              .getElementsByClassName('el-checkbox__input')[0]
+              .click()
+            this.getList()
+          })
+        } else {
+          this.depdShow = false
+        }
+      })
+    },
+    setTeamChildren(data) {
+      const arr = data.map(item => ({ value: item.code, label: item.name }))
+      return arr
+    },
+    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
+          const data = this.optionData.filter(item => item !== -1)
+          this.bizCode = 1
+          this.handleBizId(data)
+        } else {
+          const data = val.join().split(',')
+          if (one[0] !== -1 && this.bizCode === 1) { // 取消全选
+            this.bizIdCode = null
+            this.bizName = '业务线'
+            this.bizCode = 0
+            this.handleBizId([-1000])
+          } else if (one[0] === -1 && val.length < option.length) { // 点击全选以外的,取消全选
+            data.splice(0, 1)
+            this.bizIdCode = data
+            this.bizName = (name ? name + '/' : '') + (nameTow ? '' + nameTow : '')
+            this.bizCode = 0
+            this.handleBizId(data)
+          } else if (one[0] !== -1 && val.length === (option.length - 1)) { // 点击其余的全部,触发全选
+            this.bizIdCode = [...data]
+            this.bizIdCode.unshift([-1])
+            this.bizName = '业务线'
+            this.bizCode = 1
+            this.handleBizId(data)
+          } else if (one[0] !== -1) { // 基础多选
+            this.bizIdCode = data
+            this.bizName = name + (nameTow ? '/' + nameTow : '')
+            this.handleBizId(data)
+          }
+        }
+      } else { // 取消全选
+        this.handleBizId([-1000])
+        this.bizName = '业务线'
+      }
+      this.paramsReset('业务线')
+      this.getList()
+      console.log(this.params)
+    },
+    handleBizId(e) { // 业务线变动
+      this.params.bizIds = e
+    },
     search() {
       const data = {}
       // 因为高级筛选不自动搜索,所以每次出发搜索都map renderList就好。
@@ -154,7 +438,7 @@ export default {
       }
     },
     getSearchOptios() {
-      getStaffByUsername(localStorage.getItem('username')).then(async res => {
+      getStaffByUsername('shidonghai').then(async res => {
         if (res.code === 200 && res.data.deptArch) {
           const copySearchData = _.clone(this.listSearch)
           const resdata = this.resetData([res.data.deptArch])
@@ -417,5 +701,175 @@ export default {
 <style lang="less">
 .data-big-wrapper {
   padding: 0 10px;
+  .teamDrop {
+    padding-left: 15px;
+  }
+  .deptCodesClass {
+    display: inline-block;
+  }
+}
+</style>
+
+<style scoped lang="less">
+@import '@/styles/detail-pages.less';
+.dropTeam {
+  /deep/.el-scrollbar__wrap {
+    margin: 0!important;
+  }
+}
+
+/deep/.el-cascader-menu__wrap {
+      overflow: inherit;
+      height: 100%;
+    }
+
+/deep/.el-cascader-panel.is-bordered {
+      border: none;
+      border-radius: 0px;
+    }
+
+.el-container{
+  width: 100%;
+}
+
+.icon-style-i {
+  color: #F5222D;
+  font-size: 53px;
+}
+
+.scheduleTip{
+  font-size: 16px;
+  font-family: MicrosoftYaHei;
+  line-height: 19px;
+  color: #333B4A;
+  opacity: 1;
+}
+
+.schedulePeople{
+  display: flex;
+  justify-content:space-between;
+  margin: 20px 0 0;
+}
+
+.scheduleLabel{
+  font-size: 12px;
+  font-family: MicrosoftYaHei;
+  line-height: 14px;
+  color: #666;
+  opacity: 1;
+}
+.hide-open-header();
+.bg-team {
+  .bg-project();
+  padding-right: 10px;
+}
+.no-sidebar .main-header {
+  .normal-main-header()
+}
+.main-header::after {
+  .main-header-after();
+}
+.main-header {
+  .main-header();
+  margin-bottom: 0;
+  margin-right: 0;
+  border-bottom: 1px solid rgba(155, 155, 155, .2);
+  /deep/.el-tabs__nav-wrap::after {
+    height: 0;
+  }
+  .top-tabs {
+    position: absolute;
+    left: 50%;
+    transform: translate(-50%, 0);
+  }
+  .tips {
+    height: 8px;
+    width: 8px;
+    background-color: #E02020;
+    border-radius: 50%;
+    position: absolute;
+    top: 18px;
+    right: 14px;
+  }
+  .tips-last {
+    height: 8px;
+    width: 8px;
+    background-color: #E02020;
+    border-radius: 50%;
+    position: absolute;
+    top: 18px;
+    right: 0;
+  }
+}
+.main-section {
+  .main-section();
+  margin-right: 0;
+  width: calc(100% - 10px);
+  .title-name {
+    font-size:20px;
+    font-family:PingFangSC-Medium;
+    color:rgba(51,59,74,1);
+  }
+  .detail-info {
+    padding: 0 30px 20px 30px;
+  }
+  .tabs-change {
+    margin: 10px 35px 0 35px;
+  }
+}
+.my-fullCalendar {
+  padding-bottom: 150px;
+}
+.el-dropdown-link {
+  color: #333B4A;
+  font-weight: 600;
+  cursor: pointer;
+}
+/deep/.el-dropdown-menu__item {
+  max-width: 20vw;
+  overflow: scroll;
+}
+/deep/.schedule1 {
+  margin: 4px;
+  padding: 2px 10px;
+  border: none;
+}
+/deep/.schedule2 {
+  margin: 4px;
+  padding: 2px 10px;
+  border: none;
+}
+/deep/.fc-content{
+  transform: scale(1) !important;
+  margin-left: 0 !important;
+  width: auto !important;
+}
+/deep/.fc-content span{
+  bottom: 0 !important;
+}
+.icon-close {
+  z-index: 999999;
+  margin-right: 20px;
+  cursor: pointer;
+}
+.team-val {
+  color: #333333;
+  font-weight: 500;
+  margin-left: 20px;
+}
+</style>
+<style lang="less" scoped>
+.cascader {
+  position: absolute;
+  width: 7%;
+  /deep/.el-input__inner {
+    opacity: 0;
+  }
+  /deep/.el-input__icon {
+    display: none;
+  }
+  /deep/.el-cascader__tags .el-tag {
+    display: none;
+  }
 }
 </style>