Selaa lähdekoodia

人员看板过滤综合管理组

cyy 1 vuosi sitten
vanhempi
sitoutus
f45b260b18

+ 22 - 5
src/views/component/selectPositions.vue

@@ -15,6 +15,12 @@ import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
 import TreeUtils from '@/utils/tree'
 import TreeUtils from '@/utils/tree'
 
 
 export default {
 export default {
+    props:{
+        filterGroup: {
+            type: Boolean,
+            default: false
+        }
+    },
     data () {
     data () {
         const { level, userId, userInfo } = this.$store.getters
         const { level, userId, userInfo } = this.$store.getters
         return {
         return {
@@ -118,13 +124,17 @@ export default {
                 )`
                 )`
             curdPost('sql', positonsSql).then((res) => {
             curdPost('sql', positonsSql).then((res) => {
                 if (res.state === 200) {
                 if (res.state === 200) {
-                    const datas = res.variables.data
+                    let datas = res.variables.data
                     this.sqlDatas = datas
                     this.sqlDatas = datas
                     const positionsValue = []
                     const positionsValue = []
                     if (datas.length > 0) {
                     if (datas.length > 0) {
-                        // datas = datas.filter(fil => {
-                        //   return fil.DEPTH_ == 3 && fil.NAME_ !== '检验科'
-                        // })
+                        if(this.filterGroup){
+                            datas = datas.filter(fil => {
+                                console.log(datas)
+                                return fil.ID_!=="1166373874003083264" && fil.NAME_.indexOf('综合')==-1
+                            })
+                        }
+                        
                         this.options = this.toTree(datas)
                         this.options = this.toTree(datas)
                         // for (var i of this.options) {
                         // for (var i of this.options) {
                         //   //   if (i.children !== undefined) {
                         //   //   if (i.children !== undefined) {
@@ -145,11 +155,18 @@ export default {
                         //   }
                         //   }
                         // }
                         // }
                         for (var i of datas) {
                         for (var i of datas) {
+                            console.log(i,datas)
+                            
                             const itemArr = i.PATH_.split('.')
                             const itemArr = i.PATH_.split('.')
                             // 先删除前面部门的数据,比如:"xxx医院/院本部/检验科.....",只保留"检验科....."
                             // 先删除前面部门的数据,比如:"xxx医院/院本部/检验科.....",只保留"检验科....."
                             itemArr.splice(0, 2)
                             itemArr.splice(0, 2)
                             itemArr.splice(itemArr.length - 1, 1)
                             itemArr.splice(itemArr.length - 1, 1)
-                            positionsValue.push(itemArr)
+                            if(this.filterGroup&&(i.ID_==="1166373874003083264"||i.NAME_.indexOf('综合')!=-1)){
+                                
+                            }else{
+                                positionsValue.push(itemArr)
+                            }
+                            
                         }
                         }
                         // this.selectDatas = positionsValue;
                         // this.selectDatas = positionsValue;
                         this.selectDatas = positionsValue.slice(0, 2).map(item => item[item.length - 1])
                         this.selectDatas = positionsValue.slice(0, 2).map(item => item[item.length - 1])

+ 3 - 2
src/views/peopleManages/taskStatistics/index.vue

@@ -55,7 +55,7 @@
                         "
                         "
                     >
                     >
                         <!-- 部门选择 -->
                         <!-- 部门选择 -->
-                        <SelectPositions @handleFunc="handleFunc" />
+                        <SelectPositions :filterGroup="true" @handleFunc="handleFunc" />
                         <div
                         <div
                             style="
                             style="
                                 width: 30%;
                                 width: 30%;
@@ -1153,7 +1153,8 @@ export default {
             if (this.positionsIdArr.length) {
             if (this.positionsIdArr.length) {
                 const users = this.getPositionPeopleIds(this.positionsIdArr[0])
                 const users = this.getPositionPeopleIds(this.positionsIdArr[0])
                 const userIds = users.map(user => user.userId)
                 const userIds = users.map(user => user.userId)
-                const sql = `select * from t_examination where  kao_shi_ren_ in (${userIds.map(i => `'${i}'`).join(',')}) and zhuang_tai_ = '已完成'`
+                const renyuan =userIds.map(i => `'${i}'`).join(',')!=='' ? `and kao_shi_ren_ in (${userIds.map(i => `'${i}'`).join(',')})`:''
+                const sql = `select * from t_examination where zhuang_tai_ = '已完成' ${renyuan} `
                 let { variables: { data }} = await this.$common.request('sql', sql)
                 let { variables: { data }} = await this.$common.request('sql', sql)
                 if (this.startDate && this.endDate) {
                 if (this.startDate && this.endDate) {
                     data = data.filter(item => {
                     data = data.filter(item => {