yuwandanmian 1 年之前
父節點
當前提交
73fcc1dc3a

+ 7 - 7
src/views/data/frontHome/components/SearchBox2.vue

@@ -12,19 +12,19 @@
       <el-form-item label="出院时间">
       <el-form-item label="出院时间">
         <el-date-picker
         <el-date-picker
           v-model="data.start_time"
           v-model="data.start_time"
-          type="date"
-          :picker-options="pickerOptions1"
+          type="month"
+          format="yyyy 年 MM 月"
+          value-format="yyyyMM"
           placeholder="开始时间"
           placeholder="开始时间"
-          style="width: 249px;"
         />
         />
       </el-form-item>
       </el-form-item>
       <el-form-item label="">
       <el-form-item label="">
         <el-date-picker
         <el-date-picker
           v-model="data.end_time"
           v-model="data.end_time"
-          type="date"
-          :picker-options="pickerOptions2"
-          placeholder="结束时间"
-          style="width: 249px;"
+          type="month"
+          format="yyyy 年 MM 月"
+          value-format="yyyyMM"
+          placeholder="开始时间"
         />
         />
       </el-form-item>
       </el-form-item>
       <el-form-item label="" class="more-btn">
       <el-form-item label="" class="more-btn">

+ 9 - 1
src/views/data/frontHome/components/TableBox.vue

@@ -66,6 +66,12 @@ export default {
       default() {
       default() {
         return ''
         return ''
       }
       }
+    },
+    search: {
+      type: Object,
+      default() {
+        return {}
+      }
     }
     }
   },
   },
   methods: {
   methods: {
@@ -79,7 +85,9 @@ export default {
         path: '/defectRuleProblem', 
         path: '/defectRuleProblem', 
         query: { 
         query: { 
           error_rule,
           error_rule,
-          hospital_name: this.hospital_name
+          hospital_name: this.hospital_name,
+          start_time: this.search.start_time,
+          end_time: this.search.end_time
         }
         }
       })
       })
     }
     }

+ 1 - 1
src/views/data/frontHome/defectProblem.vue

@@ -2,7 +2,7 @@
   <div class="box">
   <div class="box">
     <div class="box_wrapper">
     <div class="box_wrapper">
       <SearchBoxVue :data="searchData" @search="handleSearch" />
       <SearchBoxVue :data="searchData" @search="handleSearch" />
-      <TableBoxVue :loading="loading" :data="tableData" :hospital_name="searchData.hospital_name" @export="handelExport" style="margin-top: -40px;" />
+      <TableBoxVue :loading="loading" :data="tableData" :search="searchData" :hospital_name="searchData.hospital_name" @export="handelExport" style="margin-top: -40px;" />
       <div style="overflow: hidden;">
       <div style="overflow: hidden;">
         <el-pagination
         <el-pagination
           v-if="tableData && tableData.length !== 0"
           v-if="tableData && tableData.length !== 0"

+ 9 - 1
src/views/data/frontHome/defectRuleProblem.vue

@@ -24,6 +24,7 @@
 import SearchBoxVue from './components/SearchBox2.vue'
 import SearchBoxVue from './components/SearchBox2.vue'
 import TableBoxVue from './components/TableBox2.vue'
 import TableBoxVue from './components/TableBox2.vue'
 import { errorDetailsListExport } from '@/api/excel'
 import { errorDetailsListExport } from '@/api/excel'
+import { dateFormat, getDaysInMonth } from '@/utils'
 
 
 export default {
 export default {
   components: {
   components: {
@@ -78,7 +79,8 @@ export default {
   created() {
   created() {
     this.error_rule = this.$route.query.error_rule;
     this.error_rule = this.$route.query.error_rule;
     this.searchData.hospital_name = this.$route.query.hospital_name?this.$route.query.hospital_name:'';
     this.searchData.hospital_name = this.$route.query.hospital_name?this.$route.query.hospital_name:'';
-
+    this.searchData.start_time = this.$route.query.start_time?this.$route.query.start_time:'';
+    this.searchData.end_time = this.$route.query.end_time?this.$route.query.end_time:'';
     this.getList()
     this.getList()
   },
   },
   methods: {
   methods: {
@@ -98,6 +100,12 @@ export default {
         page,
         page,
         page_size: limit
         page_size: limit
       }
       }
+      const { start_time, end_time } = this.searchData
+      const days = getDaysInMonth(end_time.slice(0, 4), end_time.slice(4, 6))
+      const dayStr = days < 10 ? `0${days}` : days
+      params.start_time = start_time.length === 8 ? start_time : `${start_time}01`
+      params.end_time = `${end_time.slice(0, 4)}${end_time.slice(4, 6)}${dayStr}`
+
       if (this.sort.length) {
       if (this.sort.length) {
         params.sort = this.sort
         params.sort = this.sort
       }
       }