Procházet zdrojové kódy

修改演练登记和案例管理 查询条件为月份

coys před 1 rokem
rodič
revize
f7fdc60bc1

+ 100 - 66
src/views/menu/drillStatistics/index.vue

@@ -8,7 +8,6 @@
           ><van-field
             v-model="fieldValue"
             label-width="6em"
-            
             :disabled="showStatus"
             label="演练计划名称"
             placeholder=""
@@ -29,12 +28,11 @@
         </van-col>
       </van-row>
       <van-row>
-        <van-col span="9">
+        <van-col span="12">
           <van-field
             v-model="currentDate"
-            
-            label-width="3em"
-            label="年份"
+            label-width="5em"
+            label="开始月份"
             placeholder=""
             :disabled="showDate"
             @click="showDate = true"
@@ -42,25 +40,43 @@
             <van-icon name="arrow-down" slot="button"
           /></van-field>
           <van-popup v-model="showDate" round position="bottom">
-            <van-picker
+            <!-- :columns="yearColumns" -->
+            <van-datetime-picker
               v-model="presentDate"
               show-toolbar
               @cancel="onCancel"
-              :columns="yearColumns"
+              type="year-month"
               @confirm="onDateConfirm"
-              :default-index="yearSelect"
               confirm-button-text="确定"
-              title="年份"
+              :default-index="yearSelect"
+              title="开始月份"
             />
           </van-popup>
         </van-col>
-        <van-col span="15">
-          <van-tabs v-model="active" @click="tbsHandler">
-            <van-tab name="01-01" title="Q1"></van-tab>
-            <van-tab name="04-01" title="Q2"></van-tab>
-            <van-tab name="07-01" title="Q3"></van-tab>
-            <van-tab name="10-01" title="Q4"></van-tab>
-          </van-tabs>
+        <van-col span="12">
+          <van-field
+            v-model="endDate"
+            label-width="5em"
+            label="结束月份"
+            placeholder=""
+            :disabled="endShowDate"
+            @click="endShowDate = true"
+          >
+            <van-icon name="arrow-down" slot="button"
+          /></van-field>
+          <van-popup v-model="endShowDate" round position="bottom">
+            <!-- :columns="yearColumns" -->
+            <van-datetime-picker
+              v-model="presentEndDate"
+              show-toolbar
+              @cancel="onCancel"
+              type="year-month"
+              @confirm="onEndDateConfirm"
+              confirm-button-text="确定"
+              :default-index="yearSelect"
+              title="结束月份"
+            />
+          </van-popup>
         </van-col>
       </van-row>
 
@@ -88,8 +104,8 @@ import selectCell from '@/components/selectCell'
 import { getrehearsalList, getTableRehearsalList } from '@/api/drillTask.js'
 import { mapGetters } from 'vuex'
 import { formatDate } from '@/filters/filter'
-import { newDateYear } from '@/utils/date.js'
-
+import { newDateMonth } from '@/utils/date.js'
+import { Toast } from 'vant'
 export default {
   components: {
     NavBar,
@@ -99,16 +115,20 @@ export default {
   },
   data() {
     return {
-      active: '',
+      // active: '',
       cascaderValue: '',
+      presentDate: '',
+      presentEndDate: '',
       showStatus: false, //状态显示隐藏
-      yearColumns: [],
+      endShowDate: false, //状态显示隐藏
+      // yearColumns: [],
       showDate: false, //月份显示隐藏
       fieldValue: '', //状态名称
       statusValue: ' ', //状态值
       taskList: [], //状态数组
       columnsList: [], //状态数组
-      currentDate: newDateYear(), //年份
+      currentDate: newDateMonth(), //年份
+      endDate: newDateMonth(), //年份
       planList: [],
       yearSelect: null,
       prop: {
@@ -136,34 +156,35 @@ export default {
     }
   },
   created() {
-    this.presentDate = new Date(newDateYear())
-    this.yearData()
-    this.getNewMonth()
+    this.presentDate = new Date(newDateMonth())
+    this.presentEndDate = new Date(newDateMonth())
+    // this.yearData()
+    // this.getNewMonth()
   },
   mounted() {
     this.initData()
   },
   computed: {},
   methods: {
-    getNewMonth() {
-      //获取当前月份
-      let date = new Date().getMonth() + 1
+    // getNewMonth() {
+    //   //获取当前月份
+    //   let date = new Date().getMonth() + 1
 
-      //默认填充当前季度
-      if (date > 7 && date < 10) {
-        this.active='07-01'
-        //三季度
-      }else if(date > 4 && date < 7){
-        //二季度
-        this.active='04-01'
-      }else if(date > 1 && date < 4){
-        //一季度
-        this.active='01-01'
-      }else{
-        this.active='10-01'
-        // 四季度
-      }
-    },
+    //   //默认填充当前季度
+    //   if (date > 7 && date < 10) {
+    //     this.active='07-01'
+    //     //三季度
+    //   }else if(date > 4 && date < 7){
+    //     //二季度
+    //     this.active='04-01'
+    //   }else if(date > 1 && date < 4){
+    //     //一季度
+    //     this.active='01-01'
+    //   }else{
+    //     this.active='10-01'
+    //     // 四季度
+    //   }
+    // },
     initData() {
       this.cascaderValue = JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID')) + ''
 
@@ -173,26 +194,25 @@ export default {
       getrehearsalList(this.cascaderValue).then(res => {
         if (res.data.length === 0) return this.$toast('暂无演练排名数据')
         this.planList = res.data
-        this.taskList=(res.data.map(item => item.name))
+        this.taskList = res.data.map(item => item.name)
 
-        this.fieldValue=res.data[0].name
-        this.statusValue=res.data[0].id
+        this.fieldValue = res.data[0].name
+        this.statusValue = res.data[0].id
         this.getDataList()
       })
     },
     //机构搜索
     getOrgDataList(val) {
-
       this.cascaderValue = val
 
       this.getDataList()
     },
     getDataList() {
-
       let data = {
         planId: this.statusValue || '',
         orgId: this.cascaderValue || '',
-        date: this.currentDate + '-' + this.active || ''
+        startTime: this.currentDate + '-01',
+        endTime: this.endDate + '-01'
       }
 
       getTableRehearsalList(data).then(res => {
@@ -217,23 +237,24 @@ export default {
       this.typeStatus = false
       this.showDate = false
       this.showStatus = false
+      this.endShowDate = false
     },
-    yearData() {
-      // 获取默认显示的时间
-      var nowTime = new Date()
-      let year = nowTime.getFullYear()
-      let month = nowTime.getMonth()
-      let day = nowTime.getDate()
-      // 循环数组 填写最小时间和最大时间范围
-      for (let i = 1980; i < 2099; i++) {
-        this.yearColumns.push(i)
-      }
-      // 格式化时间并截取
-      var years = this.formatDate(new Date(year, month, day))
-      var Year = years.slice(0, 4)
-      // 将截取的年份赋值给绑定值 用于点击弹出日期窗口后显示当前的时间
-      this.yearSelect = this.yearColumns.indexOf(Number(Year))
-    },
+    // yearData() {
+    //   // 获取默认显示的时间
+    //   var nowTime = new Date()
+    //   let year = nowTime.getFullYear()
+    //   let month = nowTime.getMonth()
+    //   let day = nowTime.getDate()
+    //   // 循环数组 填写最小时间和最大时间范围
+    //   for (let i = 1980; i < 2099; i++) {
+    //     this.yearColumns.push(i)
+    //   }
+    //   // 格式化时间并截取
+    //   var years = this.formatDate(new Date(year, month, day))
+    //   var Year = years.slice(0, 4)
+    //   // 将截取的年份赋值给绑定值 用于点击弹出日期窗口后显示当前的时间
+    //   this.yearSelect = this.yearColumns.indexOf(Number(Year))
+    // },
     //日期格式
     formatDate(date) {
       return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
@@ -246,15 +267,28 @@ export default {
       m = m < 10 ? '0' + m : m
       var d = date.getDate()
       d = d < 10 ? '0' + d : d
-      return y
+      return y + '-' + m
     },
     //月份选中触发
     onDateConfirm(val) {
+      if (this.newDate(val + '') > this.endDate) {
+        return Toast('开始月份不能大于结束月份')
+      }
       this.currentDate = this.newDate(val + '')
-
       this.showDate = false
       this.getDataList()
     },
+     //年份选中触发
+     onEndDateConfirm(val) {
+      if(this.newDate(val + '')<this.currentDate){
+        return Toast('结束月份不能小于开始月份')
+      }
+      this.endDate = this.newDate(val + '')
+      
+      console.log(this.endDate);
+      this.endShowDate = false
+      this.getDataList()
+    },
     tbsHandler() {
       this.getDataList()
     }

+ 33 - 32
src/views/menu/rehearsalTask/index.vue

@@ -43,20 +43,21 @@
             <van-icon name="arrow-down" slot="button"
           /></van-field>
           <van-popup v-model="showDate" round position="bottom">
-            <van-picker
+            <!-- :columns="yearColumns" -->
+            <van-datetime-picker
               v-model="presentDate"
               show-toolbar
               @cancel="onCancel"
-              :columns="yearColumns"
               confirm-button-text="确定"
               @confirm="onDateConfirm"
               :default-index="yearSelect"
               title="年份"
+              type="year-month"
             />
           </van-popup>
         </van-col>
       </van-row>
-      <van-row>
+      <!-- <van-row>
         <van-col span="24">
           <van-tabs v-model="active" @click="tbsHandler">
             <van-tab name="01-01" title="Q1"></van-tab>
@@ -65,7 +66,7 @@
             <van-tab name="10-01" title="Q4"></van-tab>
           </van-tabs>
         </van-col>
-      </van-row>
+      </van-row> -->
     </div>
 
     <!-- //卡片内容区域 -->
@@ -141,7 +142,7 @@ import { getdrillTask, getsignUserList } from '@/api/drillTask.js'
 import { deptTreeList } from '@/api/toConsult.js'
 import { Toast } from 'vant'
 import OrgTree from '@/components/orgTree'
-import { newDateMonth, newDateYear } from '@/utils/date.js'
+import { newDateMonth } from '@/utils/date.js'
 export default {
   data() {
     return {
@@ -163,7 +164,7 @@ export default {
       orgName: JSON.parse(sessionStorage.getItem('SET_USER_ORGNAME')) || '', //机构名称
       cascaderValue: '', //机构ID
       show: false, //机构弹框显示隐藏
-      active: '01-01',
+      // active: '01-01',
       fieldNames: {
         text: 'name',
         value: 'id',
@@ -180,7 +181,7 @@ export default {
       statusValue: ' ', //状态值
       columns: ['全部'], //状态数组
       columnsList: [], //状态数组
-      currentDate: newDateYear(), //年份
+      currentDate: newDateMonth(), //年份
       conditionShow: false //机构弹框显示隐藏
     }
   },
@@ -197,8 +198,8 @@ export default {
   },
 
   created() {
-    this.presentDate = new Date(newDateYear())
-    this.getNewMonth()
+    this.presentDate = new Date(newDateMonth())
+    // this.getNewMonth()
     this.yearData()
   },
   mounted() {
@@ -207,25 +208,25 @@ export default {
   },
   methods: {
     //getNewDate
-    getNewMonth() {
-      //获取当前月份
-      let date = new Date().getMonth() + 1
+    // getNewMonth() {
+    //   //获取当前月份
+    //   let date = new Date().getMonth() + 1
 
-      //默认填充当前季度
-      if (date > 7 && date < 10) {
-        this.active = '07-01'
-        //三季度
-      } else if (date > 4 && date < 7) {
-        //二季度
-        this.active = '04-01'
-      } else if (date > 1 && date < 4) {
-        //一季度
-        this.active = '01-01'
-      } else {
-        this.active = '10-01'
-        // 四季度
-      }
-    },
+    //   //默认填充当前季度
+    //   if (date > 7 && date < 10) {
+    //     this.active = '07-01'
+    //     //三季度
+    //   } else if (date > 4 && date < 7) {
+    //     //二季度
+    //     this.active = '04-01'
+    //   } else if (date > 1 && date < 4) {
+    //     //一季度
+    //     this.active = '01-01'
+    //   } else {
+    //     this.active = '10-01'
+    //     // 四季度
+    //   }
+    // },
     //机构搜索
     getDataList(val) {
       this.cascaderValue = val.id
@@ -333,7 +334,7 @@ export default {
       obj.orgId = this.cascaderValue || JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID')) + '' || ''
 
       if (this.currentDate) {
-        obj.date = this.currentDate + '-' + this.active
+        obj.date = this.currentDate +'-'+'01'
       }
       if (this.typeValue) {
         obj.type = this.typeValue
@@ -379,9 +380,9 @@ export default {
       this.selectListAppHandler()
       this.showStatus = false
     },
-    tbsHandler() {
-      this.selectListAppHandler()
-    },
+    // tbsHandler() {
+    //   this.selectListAppHandler()
+    // },
     //月份选中触发
     onDateConfirm(val) {
       this.currentDate = this.newDate(val + '')
@@ -412,7 +413,7 @@ export default {
       m = m < 10 ? '0' + m : m
       var d = date.getDate()
       d = d < 10 ? '0' + d : d
-      return y
+      return y+'-'+m
     },
     //日期格式
     formatDate(date) {

+ 78 - 85
src/views/menu/rehearsalTask/learning.vue

@@ -9,12 +9,11 @@
         </van-col>
       </van-row>
       <van-row>
-        <van-col span="9">
+        <van-col span="12">
           <van-field
             v-model="currentDate"
-            
-            label-width="3em"
-            label="年份"
+            label-width="5em"
+            label="开始月份"
             placeholder=""
             :disabled="showDate"
             @click="showDate = true"
@@ -22,34 +21,54 @@
             <van-icon name="arrow-down" slot="button"
           /></van-field>
           <van-popup v-model="showDate" round position="bottom">
-            <van-picker
+            <!-- :columns="yearColumns" -->
+            <van-datetime-picker
               v-model="presentDate"
               show-toolbar
               @cancel="onCancel"
-              :columns="yearColumns"
+              type="year-month"
               @confirm="onDateConfirm"
               confirm-button-text="确定"
               :default-index="yearSelect"
-              title="份"
+              title="开始月份"
             />
           </van-popup>
         </van-col>
-        <van-col span="15">
-          <van-tabs v-model="active" @click="tbsHandler">
-            <van-tab name="01-01" title="Q1"></van-tab>
-            <van-tab name="04-01" title="Q2"></van-tab>
-            <van-tab name="07-01" title="Q3"></van-tab>
-            <van-tab name="10-01" title="Q4"></van-tab>
-          </van-tabs>
+        <van-col span="12">
+          <van-field
+            v-model="endDate"
+            label-width="5em"
+            label="结束月份"
+            placeholder=""
+            :disabled="endShowDate"
+            @click="endShowDate = true"
+          >
+            <van-icon name="arrow-down" slot="button"
+          /></van-field>
+          <van-popup v-model="endShowDate" round position="bottom">
+            <!-- :columns="yearColumns" -->
+            <van-datetime-picker
+              v-model="presentEndDate"
+              show-toolbar
+              @cancel="onCancel"
+              type="year-month"
+              @confirm="onEndDateConfirm"
+              confirm-button-text="确定"
+              :default-index="yearSelect"
+              title="结束月份"
+            />
+          </van-popup>
         </van-col>
       </van-row>
       <van-row>
+        
+      </van-row>
+      <van-row>
         <van-col span="24">
           <van-tabs v-model="activeAl" @click="tbsAlHandler">
             <van-tab name="1" title="行社优秀案例"></van-tab>
             <van-tab name="3" title="地区优秀案例"></van-tab>
             <van-tab name="5" title="省级优秀案例"></van-tab>
-           
           </van-tabs>
         </van-col>
       </van-row>
@@ -69,7 +88,7 @@
               <div>单位名称</div>
               <div>{{ item.orgName }}</div>
             </div>
-           
+
             <div class="mainItem" @click="goInfo(item.id)">
               <div>演练项目</div>
               <div>{{ item.typeText }}</div>
@@ -78,12 +97,10 @@
               <div>演练时间</div>
               <div v-if="item.drillStartTime">{{ item.drillStartTime }}-{{ item.drillEndTime }}</div>
             </div>
-            
           </div>
         </van-panel>
       </van-list>
     </div>
-   
   </div>
 </template>
 <script>
@@ -93,23 +110,24 @@ import { getRecTaskList } from '@/api/optimalLearning.js'
 import { deptTreeList } from '@/api/toConsult.js'
 import { Toast } from 'vant'
 import OrgTree from '@/components/orgTree'
-import { newDateMonth, newDateYear } from '@/utils/date.js'
+import { newDateMonth } from '@/utils/date.js'
 export default {
   data() {
     return {
       orgName: '',
       orgShow: false,
       presentDate: '', //默认时间
+      presentEndDate: '', //默认结束时间
       pageNum: 1,
       loading: false, //加载状态
       finished: false, //是否全部加载完毕
-     
+
       yearColumns: [],
-     
+
       orgName: JSON.parse(sessionStorage.getItem('SET_USER_ORGNAME')) || '', //机构名称
       cascaderValue: '', //机构ID
       show: false, //机构弹框显示隐藏
-      active: '01-01',
+      // active: '01-01',
       activeAl: '1',
       fieldNames: {
         text: 'name',
@@ -123,12 +141,13 @@ export default {
 
       showStatus: false, //状态显示隐藏
       showDate: false, //月份显示隐藏
+      endShowDate: false, //月份显示隐藏
       fieldValue: '全部', //状态名称
       statusValue: ' ', //状态值
       columns: ['全部'], //状态数组
       columnsList: [], //状态数组
-      currentDate: newDateYear(), //年份
-  
+      currentDate: newDateMonth(), //年份
+      endDate: newDateMonth() //年份
     }
   },
   components: {
@@ -144,43 +163,22 @@ export default {
   },
 
   created() {
-    this.presentDate = new Date(newDateYear())
-    this.getNewMonth()
-    this.yearData()
+    this.presentDate = new Date(newDateMonth())
+    this.presentEndDate = new Date(newDateMonth())
+    
   },
   mounted() {
     this.init()
     this.cascaderValue = JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID')) + ''
   },
   methods: {
-    getNewMonth() {
-      //获取当前月份
-      let date = new Date().getMonth() + 1
-      console.log(date)
-      //默认填充当前季度
-      if (date > 7 && date < 10) {
-        this.active='07-01'
-        //三季度
-      }else if(date > 4 && date < 7){
-        //二季度
-        this.active='04-01'
-      }else if(date > 1 && date < 4){
-        //一季度
-        this.active='01-01'
-      }else{
-        this.active='10-01'
-        // 四季度
-      }
-    },
+ 
     //机构搜索
     getDataList(val) {
       this.cascaderValue = val.id
       this.orgName = val.name
       this.selectListAppHandler()
     },
-   
-  
-   
 
     //初始化
     init() {
@@ -195,7 +193,6 @@ export default {
     },
     selectListAppHandler(type = 0, callback = () => {}) {
       let obj = {
-        
         pageNum: this.pageNum,
         pageSize: 10
       }
@@ -208,19 +205,23 @@ export default {
       // }
 
       obj.orgId = this.cascaderValue || JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID')) + '' || ''
-
+        if(!this.currentDate||!this.endDate){
+         return Toast('请选择一个月份范围')
+        }
       if (this.currentDate) {
-        obj.date = this.currentDate + '-' + this.active
+        obj.startTime = this.currentDate+'-'+'01'
+      }
+      if (this.endDate) {
+        obj.endTime = this.endDate+'-'+'01'
       }
       if (this.activeAl) {
         obj.recStatus = this.activeAl
       }
-      
+
       //获取任务列表
       getRecTaskList(obj).then(res => {
         let { code, rows, msg } = res
         if (code == 200) {
-
           if (type) {
             this.taskList.push(...rows)
             if (rows.length == 0 || rows.length < 10) {
@@ -230,48 +231,41 @@ export default {
             callback()
           } else {
             this.finished = false
-            this.taskList=rows||[]
-            if(rows.length == 0){
-              this.taskList=[]
+            this.taskList = rows || []
+            if (rows.length == 0) {
+              this.taskList = []
             }
           }
-        }else{
+        } else {
           this.finished = true
-          this.taskList =[]
+          this.taskList = []
         }
       })
     },
 
-   
-    tbsHandler() {
-      this.selectListAppHandler()
-    },
     tbsAlHandler() {
       this.selectListAppHandler()
     },
     //年份选中触发
     onDateConfirm(val) {
+      if(this.newDate(val + '')>this.endDate){
+        return Toast('开始月份不能大于结束月份')
+      }
       this.currentDate = this.newDate(val + '')
-
       this.showDate = false
       this.selectListAppHandler()
     },
-    yearData() {
-      // 获取默认显示的时间
-      var nowTime = new Date()
-      let year = nowTime.getFullYear()
-      let month = nowTime.getMonth()
-      let day = nowTime.getDate()
-      // 循环数组 填写最小时间和最大时间范围
-      for (let i = 1980; i < 2099; i++) {
-        this.yearColumns.push(i)
+    //年份选中触发
+    onEndDateConfirm(val) {
+      if(this.newDate(val + '')<this.currentDate){
+        return Toast('结束月份不能小于开始月份')
       }
-      // 格式化时间并截取
-      var years = this.formatDate(new Date(year, month, day))
-      var Year = years.slice(0, 4)
-      // 将截取的年份赋值给绑定值 用于点击弹出日期窗口后显示当前的时间
-      this.yearSelect = this.yearColumns.indexOf(Number(Year))
-    }, //日期转换
+      this.endDate = this.newDate(val + '')
+      
+      console.log(this.endDate);
+      this.endShowDate = false
+      this.selectListAppHandler()
+    },
     newDate(time) {
       var date = new Date(time)
       var y = date.getFullYear()
@@ -279,7 +273,7 @@ export default {
       m = m < 10 ? '0' + m : m
       var d = date.getDate()
       d = d < 10 ? '0' + d : d
-      return y
+      return y + '-' + m
     },
     //日期格式
     formatDate(date) {
@@ -295,12 +289,10 @@ export default {
       this.selectListAppHandler(1, () => {
         this.pageNum++
         this.loading = false
-        console.log(1)
+        
       })
     },
-   
-    
-   
+
     //跳转详情
     goInfo(id) {
       this.$router.push('/rehearsalTasinfo/' + id + '_learning')
@@ -311,6 +303,7 @@ export default {
       this.typeStatus = false
       this.showDate = false
       this.showStatus = false
+      this.endShowDate = false
     }
   }
 }
@@ -342,7 +335,7 @@ export default {
   align-items: center;
   height: 100%;
   padding: 20px;
-//   border-bottom: 1px solid #1989fa;
+  //   border-bottom: 1px solid #1989fa;
 
   .title {
     font-size: 30px;

+ 88 - 53
src/views/menu/rehearsalTask/optimal.vue

@@ -9,7 +9,7 @@
         </van-col>
       </van-row>
       <van-row>
-        <van-col span="15"
+        <van-col span="24"
           ><van-field
             v-model="fieldValue"
             label-width="3em"
@@ -31,11 +31,14 @@
             />
           </van-popup>
         </van-col>
-        <van-col span="9">
+       
+      </van-row>
+      <van-row>
+        <van-col span="12">
           <van-field
             v-model="currentDate"
-            label-width="3em"
-            label="份"
+            label-width="5em"
+            label="开始月份"
             placeholder=""
             :disabled="showDate"
             @click="showDate = true"
@@ -43,33 +46,46 @@
             <van-icon name="arrow-down" slot="button"
           /></van-field>
           <van-popup v-model="showDate" round position="bottom">
-            <van-picker
+            <!-- :columns="yearColumns" -->
+            <van-datetime-picker
               v-model="presentDate"
-              @cancel="onCancel"
               show-toolbar
-              :columns="yearColumns"
+              @cancel="onCancel"
+              type="year-month"
               @confirm="onDateConfirm"
-              :default-index="yearSelect"
               confirm-button-text="确定"
-              title="年份"
+              :default-index="yearSelect"
+              title="开始月份"
             />
           </van-popup>
         </van-col>
-      </van-row>
-      <van-row>
-        <van-col span="24">
-          <van-tabs v-model="active" @click="tbsHandler">
-            <van-tab name="01-01" title="Q1"></van-tab>
-            <van-tab name="04-01" title="Q2"></van-tab>
-            <van-tab name="07-01" title="Q3"></van-tab>
-            <van-tab name="10-01" title="Q4"></van-tab>
-          </van-tabs>
+        <van-col span="12">
+          <van-field
+            v-model="endDate"
+            label-width="5em"
+            label="结束月份"
+            placeholder=""
+            :disabled="endShowDate"
+            @click="endShowDate = true"
+          >
+            <van-icon name="arrow-down" slot="button"
+          /></van-field>
+          <van-popup v-model="endShowDate" round position="bottom">
+            <!-- :columns="yearColumns" -->
+            <van-datetime-picker
+              v-model="presentEndDate"
+              show-toolbar
+              @cancel="onCancel"
+              type="year-month"
+              @confirm="onEndDateConfirm"
+              confirm-button-text="确定"
+              :default-index="yearSelect"
+              title="结束月份"
+            />
+          </van-popup>
         </van-col>
-
-        <!-- <van-col span="6" class="btnf_box">
-          <van-button type="info" class="btn" @click="clearSearch" size="small">重置</van-button>
-        </van-col> -->
       </van-row>
+     
     </div>
 
     <!-- //卡片内容区域 -->
@@ -116,7 +132,7 @@ import { getlearningListPage } from '@/api/optimalLearning.js'
 import { deptTreeList } from '@/api/toConsult.js'
 import { Toast } from 'vant'
 import OrgTree from '@/components/orgTree'
-import { newDateMonth, newDateYear } from '@/utils/date.js'
+import {  newDateMonth } from '@/utils/date.js'
 export default {
   data() {
     return {
@@ -126,20 +142,20 @@ export default {
       pageNum: 1,
       loading: false, //加载状态
       finished: false, //是否全部加载完毕
-
+      presentEndDate: '', //默认结束时间
       yearColumns: [],
 
       orgName: JSON.parse(sessionStorage.getItem('SET_USER_ORGNAME')) || '', //机构名称
       cascaderValue: '', //机构ID
       show: false, //机构弹框显示隐藏
-      active: '01-01',
+      // active: '01-01',
       fieldNames: {
         text: 'name',
         value: 'id',
         children: 'children'
       },
       taskList: [], //列表数据
-
+      endShowDate:false,
       yearSelect: null,
       value1: JSON.parse(sessionStorage.getItem('SET_USER_ID')) || '', //输入框model
       columnsList: [],
@@ -148,7 +164,8 @@ export default {
       fieldValue: '', //状态名称
       statusValue: ' ', //状态值
       columns: [], //状态数组
-      currentDate: newDateYear() //年份
+      currentDate: newDateMonth(), //年份
+      endDate: newDateMonth(), //年份
     }
   },
   components: {
@@ -164,7 +181,7 @@ export default {
   },
 
   created() {
-    this.presentDate = new Date(newDateYear())
+    this.presentDate = new Date(newDateMonth())
     let orgType = window.sessionStorage.getItem('SET_USER_ORGTYPE')
       switch (orgType) {
         case '2':
@@ -184,32 +201,32 @@ export default {
           break
       }
     this.yearData()
-    this.getNewMonth()
+    // this.getNewMonth()
   },
   mounted() {
     this.cascaderValue = JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID')) + ''
     this.init()
   },
   methods: {
-    getNewMonth() {
-      //获取当前月份
-      let date = new Date().getMonth() + 1
+    // getNewMonth() {
+    //   //获取当前月份
+    //   let date = new Date().getMonth() + 1
 
-      //默认填充当前季度
-      if (date > 7 && date < 10) {
-        this.active = '07-01'
-        //三季度
-      } else if (date > 4 && date < 7) {
-        //二季度
-        this.active = '04-01'
-      } else if (date > 1 && date < 4) {
-        //一季度
-        this.active = '01-01'
-      } else {
-        this.active = '10-01'
-        // 四季度
-      }
-    },
+    //   //默认填充当前季度
+    //   if (date > 7 && date < 10) {
+    //     this.active = '07-01'
+    //     //三季度
+    //   } else if (date > 4 && date < 7) {
+    //     //二季度
+    //     this.active = '04-01'
+    //   } else if (date > 1 && date < 4) {
+    //     //一季度
+    //     this.active = '01-01'
+    //   } else {
+    //     this.active = '10-01'
+    //     // 四季度
+    //   }
+    // },
     //机构搜索
     getDataList(val) {
       this.cascaderValue = val.id
@@ -290,7 +307,10 @@ export default {
       obj.orgId = this.cascaderValue || JSON.parse(window.sessionStorage.getItem('SET_USER_ORGID')) + '' || ''
 
       if (this.currentDate) {
-        obj.date = this.currentDate + '-' + this.active
+        obj.startTime = this.currentDate+'-'+'01'
+      }
+      if (this.endDate) {
+        obj.endTime = this.endDate+'-'+'01'
       }
 
       //获取任务列表
@@ -332,16 +352,30 @@ export default {
       this.selectListAppHandler()
       this.showStatus = false
     },
-    tbsHandler() {
-      this.selectListAppHandler()
-    },
+    // tbsHandler() {
+    //   this.selectListAppHandler()
+    // },
     //月份选中触发
+    //年份选中触发
     onDateConfirm(val) {
+      if(this.newDate(val + '')>this.endDate){
+        return Toast('开始月份不能大于结束月份')
+      }
       this.currentDate = this.newDate(val + '')
-
       this.showDate = false
       this.selectListAppHandler()
     },
+    //年份选中触发
+    onEndDateConfirm(val) {
+      if(this.newDate(val + '')<this.currentDate){
+        return Toast('结束月份不能小于开始月份')
+      }
+      this.endDate = this.newDate(val + '')
+      
+      console.log(this.endDate);
+      this.endShowDate = false
+      this.selectListAppHandler()
+    },
     yearData() {
       // 获取默认显示的时间
       var nowTime = new Date()
@@ -365,7 +399,7 @@ export default {
       m = m < 10 ? '0' + m : m
       var d = date.getDate()
       d = d < 10 ? '0' + d : d
-      return y
+      return y+ '-' + m
     },
     //日期格式
     formatDate(date) {
@@ -399,6 +433,7 @@ export default {
       this.typeStatus = false
       this.showDate = false
       this.showStatus = false
+      this.endShowDate = false
     }
   }
 }

+ 2 - 2
vue.config.js

@@ -110,9 +110,9 @@ module.exports = defineConfig({
         }
       },
       '/dev': {
-        target: "http://10.87.10.55:8080",
+        // target: "http://10.87.10.55:8080",
         // target: "http://10.87.10.91:8080",
-        // target: "http://10.87.11.173:8080",
+        target: "http://10.87.11.173:8080",
         // ws:true,
         changOrigin:true,
         pathRewrite:{