Browse Source

bug修复

qymljy 9 months ago
parent
commit
adf9467a74

+ 30 - 2
src/HDrpManagement/dataanalysis/components/quickDate.vue

@@ -27,12 +27,18 @@ export default {
   props:['disabled'],
   data(){
     return {
-      select:'',
+      select:'',
       value:'',
       begindate:'',
-      enddate:''
+      enddate:'',
+      currentWeekStart: '',
+      currentWeekEnd: ''
     }
   },
+  mounted() {
+    this.getMonth('s')
+    this.getMonth('e')
+  },
   methods:{
     selectQuick(val){
       this.value = ''
@@ -45,10 +51,12 @@ export default {
         var day = new Date().getDate();
         this.begindate = year + '-' + month + '-' + day
         this.enddate = year + '-' + month + '-' + day
+        this.value = [this.begindate,this.enddate]
       }else if (val === 2){
         this.select = '周'
         this.getMonday('s')
         this.getMonday('e')
+        // this.updateCurrentWeek()
       }else if (val === 3){
         this.select = '月'
         this.getMonth('s')
@@ -82,6 +90,7 @@ export default {
       d = d < 10 ? "0" + d: d
       var day = y + "-" + m + "-" + d
       type == 's'?this.begindate = day : this.enddate = day
+      this.value = [this.begindate,this.enddate]
     },
     getMonth(type, months) {
       var d = new Date();
@@ -110,6 +119,7 @@ export default {
         day = lastday
         this.enddate = lastday
       }
+      this.value = [this.begindate,this.enddate]
     },
     getYear(type, dates) {
       var dd = new Date()
@@ -125,6 +135,7 @@ export default {
         var day = year + "-01-01/" + year + "-12-31"
       }
       type == 's'?this.begindate = day : this.enddate = day
+      this.value = [this.begindate,this.enddate]
     },
     selectDate(){
       this.begindate = ''
@@ -135,6 +146,23 @@ export default {
         this.enddate = this.value[1]
       }
       this.$emit('selectQuick',this.begindate,this.enddate,this.select)
+    },
+    updateCurrentWeek() {
+      const today = new Date();
+      const dayOfWeek = today.getDay(); // 0代表周日,1代表周一
+      const startOfWeek = new Date(today);
+      startOfWeek.setDate(startOfWeek.getDate() - (dayOfWeek - 1)); // 从今天调整到周一开始
+
+      const endOfWeek = new Date(startOfWeek);
+      endOfWeek.setDate(startOfWeek.getDate() + 6); // 一周有7天
+
+      this.currentWeekStart = startOfWeek.toLocaleDateString();
+      this.currentWeekEnd = endOfWeek.toLocaleDateString();
+      this.currentWeekStart = this.currentWeekStart.replace(/\//g,'-')
+      this.currentWeekEnd = this.currentWeekEnd.replace(/\//g,'-')
+      console.log(this.currentWeekStart,'开始')
+      console.log(this.currentWeekEnd,'结束')
+      this.value = [this.currentWeekStart,this.currentWeekEnd]
     }
   }
 }

+ 7 - 21
src/HDrpManagement/publicManage/components/scopeOfAuthority/modules/dep_auth.vue

@@ -2,18 +2,17 @@
   <div>
     <el-row :gutter="20">
       <el-col :span="24" style="padding:0 16px">
-        <el-input size="small" v-model="param.content.where.condition" class="normal-margin" :placeholder="$t('搜索人员')" clearable @keyup.enter.native="searchChange"></el-input>
+        <el-input size="small" v-model="param.content.where.condition" class="normal-margin" :placeholder="$t('搜索人员')" clearable @keyup.enter.native="searchChange" ></el-input>
       </el-col>
       <el-col :span="12">
         <div class="tree-panel">
-        <div :class="['allData',{'active':active}]" @click="allClick">{{$t(`全部`)}}</div>
           <el-tree
             ref="tree"
             :data="deplist"
             node-key="departmentid"
             default-expand-all
             highlight-current
-            :check-strictly="true"
+            :check-strictly="false"
             :check-on-click-node="false"
             :expand-on-click-node="false"
             :show-checkbox="true"
@@ -98,34 +97,25 @@ export default {
             "nocahe":true,
             "pageNumber": 1,
             "pageSize": 10000,
-            "departmentids":[],
+            "departmentids":"",
             "containssub":1,
             "where": {
               "condition": "",
-              "status": "ACTIVE"
+              "status": ""
             }
         }
       }
     }
   },
-  watch: {
-  },
   methods:{
     searchChange () {
       this.active = true
       this.$refs.tree.setCurrentKey(null)
       this.param.content.isAll = 1
-      this.menberList([])
-    },
-    allClick () {
-      this.active = true
-      this.$refs.tree.setCurrentKey(null)
-      this.param.content.isAll = 1
-      this.menberList([])
+      this.menberList(this.param.content.departmentids[0])
     },
     // 查询部门
     async department () {
-      console.log(this.$route.query.id,this.obiectId)
       const res = await this.$api.requested({
         "classname": "webmanage.department.department",
         "method": "querydepartment_auth",
@@ -138,7 +128,7 @@ export default {
       this.responseData = res.data
       this.deplist = this.createMenu(res.data)
       this.$emit('onClick',{data:this.deplist[0],parent:[]})
-
+      this.menberList(this.deplist[0].value)
       // 如果存在默认组织数据就执行
     },
 
@@ -184,8 +174,6 @@ export default {
       this.param.content.departmentids = [val]
       const res = await this.$api.requested(this.param)
       this.menberData = res.data
-      console.log(this.menberData);
-
       this.loading = false
       if(this.allDataLength == '') this.allDataLength = this.menberData.length
       // this.allDataLength = this.menberData.length
@@ -211,7 +199,6 @@ export default {
       this.param.content.isAll = 0
       this.clickdepid = row.departmentid
       this.menberList(row.departmentid)
-      this.active = false
 
     },
     // 勾选部门
@@ -234,7 +221,7 @@ export default {
         this.departmentids = arr
       }
       this.departmentids = [...new Set(this.departmentids)]
-      this.$refs.tree.setCheckedKeys(this.departmentids)
+      // this.$refs.tree.setCheckedKeys(this.departmentids)
       this.$emit('onParams',this.departmentids,this.checkedMenbers,this.isonlymanager_dept)
     },
     // 勾选人员
@@ -271,7 +258,6 @@ export default {
   mounted () {
     setTimeout(() => {
       this.department()
-      this.allClick()
     }, 1000);
   },
   watch:{

+ 6 - 15
src/HDrpManagement/publicManage/components/scopeOfAuthority/modules/mar_auth.vue

@@ -6,14 +6,13 @@
       </el-col>
       <el-col :span="12">
         <div class="tree-panel">
-          <div :class="['allData',{'active':active}]" @click="allClick">{{$t(`全部`)}}</div>
           <el-tree
             ref="tree"
             :data="deplist"
             node-key="sa_saleareaid"
             default-expand-all
             highlight-current
-            :check-strictly="true"
+            :check-strictly="false"
             :check-on-click-node="false"
             :expand-on-click-node="false"
             :show-checkbox="true"
@@ -97,11 +96,11 @@ export default {
         "content": {
             "pageNumber": 1,
             "pageSize": 10000,
-            "sa_saleareaids":[],
+            "sa_saleareaids":"",
             "containssub":1,
             "where": {
               "condition": "",
-              "status": "ACTIVE"
+              "status": ""
             }
         }
       }
@@ -112,13 +111,7 @@ export default {
       this.active = true
       this.$refs.tree.setCurrentKey(null)
       this.param.content.isAll = 1
-      this.menberList([])
-    },
-    allClick () {
-      this.active = true
-      this.$refs.tree.setCurrentKey(null)
-      this.param.content.isAll = 1
-      this.menberList([])
+      this.menberList(this.param.content.departmentids[0])
     },
     // 查询区域
     async department () {
@@ -135,7 +128,7 @@ export default {
       this.responseData = res.data
       this.deplist = this.createMenu(res.data)
       this.$emit('onClick',{data:this.deplist[0],parent:[]})
-
+      this.menberList([this.deplist[0].sa_saleareaid])
       // 如果存在默认组织数据就执行
     },
 
@@ -199,7 +192,6 @@ export default {
       this.param.content.isAll = 0
       this.clickdepid = row.sa_saleareaid
       this.menberList([row.sa_saleareaid])
-      this.active = false
       // this.onCheckedMenber.length === this.menberData.length?this.checkAll = true:this.checkAll = false
     },
     // 勾选部门
@@ -221,7 +213,7 @@ export default {
         this.saleareaids = arr
       }
       this.saleareaids = [...new Set(this.saleareaids)]
-      this.$refs.tree.setCheckedKeys(this.saleareaids)
+      // this.$refs.tree.setCheckedKeys(this.saleareaids)
       this.$emit('onAgentParams',this.saleareaids,this.checkedMenbers,this.isonlymanager_agent)
     },
     // 勾选人员
@@ -256,7 +248,6 @@ export default {
   mounted () {
     setTimeout(() => {
       this.department()
-      this.allClick()
     }, 1000);
   },
   watch:{