瀏覽代碼

Merge branch 'v0.1.0' of http://10.87.21.221:8000/jzyd_yyds/soc_app into v0.1.0

zhulu 1 年之前
父節點
當前提交
c2fb35fd22
共有 2 個文件被更改,包括 44 次插入54 次删除
  1. 2 2
      src/views/menu/resumption/api.js
  2. 42 52
      src/views/menu/resumptionStatistics/index.vue

+ 2 - 2
src/views/menu/resumption/api.js

@@ -28,7 +28,7 @@ export function dataList(data) {
 export function selectResumptionReport(data) {
   return request({
     url: '/core/resumptionReport/list',
-    method: 'get',
-    params: data
+    method: 'post',
+    data
   })
 }

+ 42 - 52
src/views/menu/resumptionStatistics/index.vue

@@ -4,51 +4,37 @@
     <div class="statistics-container">
       <org-tree v-model="orgId" @change="getOrgDataList"></org-tree>
       <van-row>
-        <van-col span="11">
-          <van-cell title="周期" @click="showSelectType = true" is-link arrow-direction="down" :value="selectTypeText"/>
-          <van-popup v-model="showSelectType" round position="bottom">
-            <van-picker
-              title="统计周期"
-              show-toolbar
-              :columns="selectTypeList"
-              @confirm="onSelectTypeConfirm"
-              @cancel="onCancel"
-              confirm-button-text="确定"
-              :close-on-click-overlay="false"
-            />
-          </van-popup>
-        </van-col>
-        <van-col span="13">
-          <van-cell title="日期" @click="showDate = true" is-link arrow-direction="down" :value="showSelectTimeText"
-                    v-if="selectType==1"/>
-          <van-popup v-model="showDate" round position="bottom">
+        <van-col span="24">
+          <van-cell title="开始日期" @click="showStartDate = true" is-link arrow-direction="down" :value="showStartSelectTimeText"/>
+          <van-popup v-model="showStartDate" round position="bottom">
             <van-datetime-picker
               v-model="startDate"
               show-toolbar
               @cancel="onCancel"
               type="date"
-              @confirm="onDateConfirm"
+              @confirm="onStartDateConfirm"
               confirm-button-text="确定"
-              title="统计日期"
+              title="开始时间"
               :formatter="formatter"
             />
           </van-popup>
         </van-col>
-        <van-col span="13">
-          <van-cell title="月份" @click="showMonth = true" is-link arrow-direction="down" :value="showSelectTimeText"
-                    v-if="selectType==2"/>
-          <van-popup v-model="showMonth" round position="bottom">
-            <van-datetime-picker
-              v-model="startDate"
-              show-toolbar
-              @cancel="onCancel"
-              type="year-month"
-              @confirm="onMonthConfirm"
-              confirm-button-text="确定"
-              title="统计月份"
-              :formatter="formatter"
-            />
-          </van-popup>
+      </van-row>
+      <van-row>
+        <van-col span="24">
+        <van-cell title="结束日期" @click="showEndDate = true" is-link arrow-direction="down" :value="showEndSelectTimeText"/>
+        <van-popup v-model="showEndDate" round position="bottom">
+          <van-datetime-picker
+            v-model="endDate"
+            show-toolbar
+            @cancel="onCancel"
+            type="date"
+            @confirm="onEndDateConfirm"
+            confirm-button-text="确定"
+            title="结束时间"
+            :formatter="formatter"
+          />
+        </van-popup>
         </van-col>
       </van-row>
 
@@ -87,16 +73,18 @@ export default {
       orgId: '',
       showSelectType: false, //状态显示隐藏
       startDate: this.initDate(),
+      endDate: this.initDate(),
       // yearColumns: [],
-      showDate: false, //月份显示隐藏
-      showMonth: false, //月份显示隐藏
+      showStartDate: false, //开始日期显示隐藏
+      showEndDate: false, //结束日期显示隐藏
       selectTypeText: '日', //查询类型名称
       selectType: 1, //默认为日的查询类型
       selectTypeList: [
         {text: '日', value: 1},
         {text: '月', value: 2}
       ],
-      showSelectTimeText: this.getDayStr(new Date()),
+      showStartSelectTimeText: this.getDayStr(new Date()),
+      showEndSelectTimeText: this.getDayStr(new Date()),
       searchTime: dayjs(new Date()),
       columns: [
         {
@@ -153,7 +141,10 @@ export default {
       let data = {
         orgId: this.orgId,
         cycle: this.selectType,
-        searchTime: this.showSelectTimeText
+        searchTime: this.showStartSelectTimeText,
+        startTime: new Date(this.startDate), // 假设 this.startDate 是日期字符串
+        endTime: new Date(this.endDate), // 假设 this.endDate 是日期字符串
+        appSelect : 1, //App与Web端共用一个接口,以此字段区分
       }
       selectResumptionReport(data).then(res => {
         this.dataList = res.data
@@ -166,30 +157,29 @@ export default {
       this.showSelectType = false;
       // 只有在用户选择了日期类型后,才显示日期选择器
       if (this.selectType === 1) {
-        this.showDate = true;
-        this.showMonth = false;
+        this.showStartDate = true;
+
       } else {
-        this.showMonth = true;
-        this.showDate = false;
+        this.showStartDate = false;
       }
     },
     onCancel() {
       this.showSelectType = false;
-      this.showDate = false;
-      this.showMonth = false;
+      this.showStartDate = false;
     },
     //日期选中触发
-    onDateConfirm(val) {
-      this.showSelectTimeText = this.getDayStr(val);
+    onStartDateConfirm(val) {
+      this.showStartSelectTimeText = this.getDayStr(val);
       this.startDate = val;
-      this.showDate = false;
+      this.showStartDate = false;
+      this.showEndDate = true;
       this.getDataList()
     },
     //月份选中触发
-    onMonthConfirm(val) {
-      this.showSelectTimeText = this.getDayStr(val, 'YYYY-MM')
-      this.startDate = val;
-      this.showDate = false;
+    onEndDateConfirm(val) {
+      this.showEndSelectTimeText = this.getDayStr(val)
+      this.endDate = val;
+      this.showEndDate = false;
       this.getDataList()
     },