Selaa lähdekoodia

修改存在的问题

zaijin 2 vuotta sitten
vanhempi
commit
1f71c7d980

+ 129 - 119
App.vue

@@ -1,125 +1,135 @@
 <script>
 import { config } from '@/common/config.js';
 export default {
-	data() {
-		return {
-			downloadUrl: '',
-			version: ''
-		};
-	},
-	onLaunch: function() {
-		console.log('App Launch');
-	},
-	onShow: function() {
-		console.log('App Show');
-		this.getDownloadUrl();
-	},
-	methods: {
-		/**
-		 * 通过参数设置获取最新版本信息
-		 */
-		getVersion() {
-			const _this = this;
-			uni.$u.api
-				.getParameterApi({
-					key: 'parking.operation.version'
-				})
-				.then(res => {
-					if (res.code === 200) {
-						this.version = res.msg
-						if (res.msg !== config.version) {
-							_this.downloadAppFileByBackstage()
-						}
-					}
-				});
-		},
-		/**
-		 * 通过参数设置获取最新下载链接
-		 */
-		getDownloadUrl() {
-			uni.$u.api
-				.getParameterApi({
-					key: 'parking.operation.package'
-				})
-				.then(res => {
-					if (res.code === 200) {
-						this.downloadUrl = res?.msg;
-						this.getVersion();
-					}
-				});
-		},
-		/**
-		 * 下载app通过downloadFile
-		 */
-		downloadAppFile() {
-			const _this = this
-			uni.showLoading({
-				mask: true,
-				title: '下载中...'
-			})
-			let downloadTask = uni.downloadFile({ // 执行下载
-				url: _this.downloadUrl,
-				success: downloadResult => {
-					// 下载成功
-					if (downloadResult.statusCode === 200) {
-						uni.showModal({
-							title: '',
-							content: '下载成功,确定现在安装吗?',
-							confirmText: '安装',
-							confirmColor: '#EE8F57',
-							success: function(res) {
-								if (res.confirm) {
-									plus.runtime.install( // 安装
-										downloadResult.tempFilePath, {
-											force: true
-										},
-										function() {
-											plus.runtime.restart();
-											uni.navigateBack()
-										},
-										function(e) {
-											utils.showToast('安装失败');
-										}
-									);
-								}
-							}
-						});
-					}
-				},
-				complete: (res) => {
-					uni.hideLoading();
-				}
-			});
-			downloadTask.onProgressUpdate((res) => {
-				if (res.progress === 100) {
-					uni.hideLoading();
-				}
-			});
-		},
-		/**
-		 * 下载app通过后台任务栏
-		 */
-		downloadAppFileByBackstage() {
-			uni.$u.route({
-				url: 'pages/appUpdate/appUpdate',
-				params: {
-					downloadUrl: this.downloadUrl,
-					version: this.version
-				}
-			})
-		},
-		/**
-		 * 下载app通过浏览器
-		 */
-		downloadAppFileByBrowser() {
-			// #ifdef APP-PLUS
-			plus.runtime.openURL(this.downloadUrl);
-			// #endif
-		}
-	},
-	onHide: function() {
-		console.log('App Hide');
-	}
+  data() {
+    return {
+      downloadUrl: '',
+      version: '',
+      timer: null
+    };
+  },
+  onLaunch: function () {
+    console.log('App Launch');
+  },
+  onShow: function () {
+    console.log('App Show');
+    this.getDownloadUrl();
+    this.timer = setInterval(() => {
+      this.getDownloadUrl();
+    }, 60000);
+  },
+  onUnload: function () {
+    clearInterval(this.timer);
+  },
+  methods: {
+    /**
+     * 通过参数设置获取最新版本信息
+     */
+    getVersion() {
+      const _this = this;
+      uni.$u.api
+        .getParameterApi({
+          key: 'parking.operation.version'
+        })
+        .then((res) => {
+          if (res.code === 200) {
+            this.version = res.msg;
+            if (res.msg !== config.version) {
+              _this.downloadAppFileByBackstage();
+            }
+          }
+        });
+    },
+    /**
+     * 通过参数设置获取最新下载链接
+     */
+    getDownloadUrl() {
+      uni.$u.api
+        .getParameterApi({
+          key: 'parking.operation.package'
+        })
+        .then((res) => {
+          if (res.code === 200) {
+            this.downloadUrl = res?.msg;
+            this.getVersion();
+          }
+        });
+    },
+    /**
+     * 下载app通过downloadFile
+     */
+    downloadAppFile() {
+      const _this = this;
+      uni.showLoading({
+        mask: true,
+        title: '下载中...'
+      });
+      let downloadTask = uni.downloadFile({
+        // 执行下载
+        url: _this.downloadUrl,
+        success: (downloadResult) => {
+          // 下载成功
+          if (downloadResult.statusCode === 200) {
+            uni.showModal({
+              title: '',
+              content: '下载成功,确定现在安装吗?',
+              confirmText: '安装',
+              confirmColor: '#EE8F57',
+              success: function (res) {
+                if (res.confirm) {
+                  plus.runtime.install(
+                    // 安装
+                    downloadResult.tempFilePath,
+                    {
+                      force: true
+                    },
+                    function () {
+                      plus.runtime.restart();
+                      uni.navigateBack();
+                    },
+                    function (e) {
+                      utils.showToast('安装失败');
+                    }
+                  );
+                }
+              }
+            });
+          }
+        },
+        complete: (res) => {
+          uni.hideLoading();
+        }
+      });
+      downloadTask.onProgressUpdate((res) => {
+        if (res.progress === 100) {
+          uni.hideLoading();
+        }
+      });
+    },
+    /**
+     * 下载app通过后台任务栏
+     */
+    downloadAppFileByBackstage() {
+      uni.$u.route({
+        url: 'pages/appUpdate/appUpdate',
+        params: {
+          downloadUrl: this.downloadUrl,
+          version: this.version
+        }
+      });
+    },
+    /**
+     * 下载app通过浏览器
+     */
+    downloadAppFileByBrowser() {
+      // #ifdef APP-PLUS
+      plus.runtime.openURL(this.downloadUrl);
+      // #endif
+    }
+  },
+  onHide: function () {
+    console.log('App Hide');
+  }
 };
 </script>
 

+ 55 - 42
components/pieChart.vue

@@ -1,52 +1,65 @@
 <!-- 饼图 -->
 <template>
-	<view class="charts-box">
-		<view class="charts-box-title">{{ title }}</view>
-		<qiun-data-charts type="pie" :canvas2d="true" :ontouch="true" :chartData="chartData" :opts="opts" />
-	</view>
+  <view class="charts-box">
+    <view class="charts-box-title">{{ title }}</view>
+    <qiun-data-charts type="pie" :canvas2d="true" :ontouch="true" :chartData="chartData" :opts="opts" />
+  </view>
 </template>
 
 <script>
-	export default {
-		props: {
-			chartData: {
-				type: Object,
-				default: () => {
-					return {}
-				}
-			},
-			title: {
-				type: [String, Number],
-				default: ''
-			},
-			opts: {
-				type: Object,
-				default: () => {
-					return {
-						dataLabel: true,
-						legend: {
-							position: 'bottom',
-							lineHeight: 20
-						}
-					}
-				}
-			}
-		},
-		data() {
-			return {}
-		}
-	}
+export default {
+  props: {
+    chartData: {
+      type: Object,
+      default: () => {
+        return {};
+      }
+    },
+    title: {
+      type: [String, Number],
+      default: ''
+    },
+    opts: {
+      type: Object,
+      default: () => {
+        return {
+          // color: ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'],
+          dataLabel: true,
+          legend: {
+            position: 'bottom',
+            lineHeight: 20
+          },
+          extra: {
+            pie: {
+              activeOpacity: 0.5,
+              activeRadius: 10,
+              offsetAngle: 0,
+              labelWidth: 15,
+              border: true,
+              borderWidth: 3,
+              borderColor: '#FFFFFF',
+							linearType: 'custom'
+            }
+          }
+        };
+      }
+    }
+  },
+  data() {
+    return {};
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-	.charts-box {
-		background-color: #fff;
-		border-radius: 5px;
-		padding: 18px 15px;
+.charts-box {
+  background-color: #fff;
+  border-radius: 5px;
+  padding: 18px 15px;
 
-		&-title {
-			text-align: center;
-			margin-bottom: 10px;
-		}
-	}
+  &-title {
+    text-align: center;
+    margin-bottom: 10px;
+  }
+}
 </style>

+ 89 - 38
components/tableRanking.vue

@@ -1,40 +1,65 @@
 <!-- 表格 -->
 <template>
-  <view class="container">
-    <view class="table" :style="{ padding: padding }">
-      <view class="table-title" v-if="title">{{ title }}</view>
-      <view class="table-box">
-        <uni-table emptyText="暂无更多数据" :loading="loading">
-          <!-- 表头行 -->
-          <uni-tr>
-            <uni-th
-              class="table-box-th"
-              align="center"
-              v-for="(item, index) in tableTh"
-              :key="index"
-              :width="item.width || ''"
-            >{{ item.field }}</uni-th>
-          </uni-tr>
-          <!-- 表格数据行 -->
-          <uni-tr v-for="(item, index) in tableData.list" :key="index">
-            <uni-td
-              class="table-box-td"
-              align="center"
-              v-for="(field, index) in tableTh"
-              :key="index"
-            >{{ item[field.key] || item[field.key] === 0 ? item[field.key] : '-' }}</uni-td>
-          </uni-tr>
-        </uni-table>
+  <view>
+    <template v-if="isScroll">
+      <movable-area scale-area>
+        <movable-view y="10" style="height: 10px" direction="horizontal" scale scale-min="1" scale-max="4">
+          <view class="container">
+            <view class="table" :style="{ padding: padding }">
+              <view class="table-title" v-if="title">{{ title }}</view>
+              <view class="table-box">
+                <uni-table emptyText="暂无更多数据" :loading="loading">
+                  <!-- 表头行 -->
+                  <view class="tableHead">
+                    <uni-tr>
+                      <uni-th class="table-box-th" align="center" v-for="(item, index) in tableTh" :key="index" :width="item.width || ''">{{
+                        item.field
+                      }}</uni-th>
+                    </uni-tr>
+                  </view>
+                  <!-- 表格数据行 -->
+                  <view class="tableBody">
+                    <uni-tr v-for="(item, index) in tableData.list" :key="index">
+                      <uni-td class="table-box-td" align="center" v-for="(field, index) in tableTh" :key="index" :width="field.width || ''">{{
+                        item[field.key] || item[field.key] === 0 ? item[field.key] : '-'
+                      }}</uni-td>
+                    </uni-tr>
+                  </view>
+                </uni-table>
+              </view>
+              <view class="table-pagination" v-if="tableData.total > 0">
+                <uni-pagination show-icon="true" :total="tableData.total" :current="tableData.current" @change="pageChange"></uni-pagination>
+              </view>
+            </view>
+          </view>
+        </movable-view> </movable-area
+    ></template>
+    <template v-else>
+      <view class="container">
+        <view class="table" :style="{ padding: padding }">
+          <view class="table-title" v-if="title">{{ title }}</view>
+          <view class="table-box">
+            <uni-table emptyText="暂无更多数据" :loading="loading">
+              <!-- 表头行 -->
+              <uni-tr>
+                <uni-th class="table-box-th" align="center" v-for="(item, index) in tableTh" :key="index" :width="item.width || ''">{{
+                  item.field
+                }}</uni-th>
+              </uni-tr>
+              <!-- 表格数据行 -->
+              <uni-tr v-for="(item, index) in tableData.list" :key="index">
+                <uni-td class="table-box-td" align="center" v-for="(field, index) in tableTh" :key="index" :width="field.width || ''">{{
+                  item[field.key] || item[field.key] === 0 ? item[field.key] : '-'
+                }}</uni-td>
+              </uni-tr>
+            </uni-table>
+          </view>
+          <view class="table-pagination" v-if="tableData.total > 0">
+            <uni-pagination show-icon="true" :total="tableData.total" :current="tableData.current" @change="pageChange"></uni-pagination>
+          </view>
+        </view>
       </view>
-      <view class="table-pagination" v-if="tableData.total > 0">
-        <uni-pagination
-          show-icon="true"
-          :total="tableData.total"
-          :current="tableData.current"
-          @change="pageChange"
-        ></uni-pagination>
-      </view>
-    </view>
+    </template>
   </view>
 </template>
 
@@ -55,6 +80,10 @@ export default {
       type: String,
       default: '15px'
     },
+    isScroll: {
+      type: Boolean,
+      default: false
+    },
     tableTh: {
       type: Array,
       default: () => {
@@ -79,11 +108,33 @@ export default {
   }
 };
 </script>
-/**
- * tableTh
- * [{ width: '', field: '', key: '' }]   width表示单列的宽度  field表示单列的表头名称  key表示单列字段名
- */
+/** * tableTh * [{ width: '', field: '', key: '' }] width表示单列的宽度 field表示单列的表头名称 key表示单列字段名 */
 
 <style lang="scss" scoped>
+movable-view {
+  display: flex;
+  width: auto;
+  height: auto;
+  min-width: 100%;
+}
+movable-area {
+  height: 100%;
+  width: 100%;
+  position: fixed;
+  overflow: scroll;
+}
+.tableHead {
+  font-weight: bold;
+  color: #333333;
+  background: #f4f6ff;
+  z-index: 20;
+  position: fixed;
+  top: 0;
+}
+.tableBody {
+  max-height: calc(100vh - 254px);
+  overflow: scroll;
+  margin-top: 60px;
+}
 @import 'static/styles/report.scss';
 </style>

+ 7 - 5
pages/appUpdate/appUpdate.vue

@@ -56,7 +56,7 @@ export default {
     this.updateInfo.downloadUrl = option.downloadUrl;
   },
   onBackPress(e) {
-    if (e.from == 'backbutton') return true; //APP安卓物理返回键逻辑
+    if (e.from == 'backbutton') return true; // APP安卓物理返回键逻辑
   },
   computed: {
     // 下载进度计算
@@ -85,6 +85,7 @@ export default {
   methods: {
     // 当点击更新时
     onUpdate() {
+      clearInterval(getApp().timer);
       //判断是否为wifi模式
       uni.getNetworkType({
         success: (res) => {
@@ -108,6 +109,7 @@ export default {
      * 取消升级
      */
     cancel() {
+      clearInterval(getApp().timer);
       uni.$u.route({
         type: 'back',
         delta: 1
@@ -285,10 +287,10 @@ export default {
       background-color: #6526f3;
       margin-top: 20rpx;
     }
-		.cancel {
-			background-color: #cccccc;
-			color: #6526f3;
-		}
+    .cancel {
+      background-color: #cccccc;
+      color: #6526f3;
+    }
   }
 }
 

+ 48 - 34
pages/collectorManagement/performanceRanking/performanceRanking.vue

@@ -3,18 +3,18 @@
  * @Author: 空白格
  * @Date: 2022-06-20 09:15:39
  * @LastEditors: 空白格
- * @LastEditTime: 2022-06-20 15:49:36
+ * @LastEditTime: 2022-11-16 13:38:03
  * @FilePath: \parking_operation\pages\collectorManagement\performanceRanking\performanceRanking.vue
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved. 
 -->
 
 <template>
   <view class="performance-ranking">
-    <!-- <view class="performance-ranking-search">
+    <view class="performance-ranking-search">
       <view class="performance-ranking-search-item">
         <uni-datetime-picker v-model="dateRange" type="daterange" @change="dateChange" />
       </view>
-      <view class="performance-ranking-search-item">
+      <!-- <view class="performance-ranking-search-item">
         <yealuoInputs
           v-if="loadAcheve"
           ref="yealuoInputs"
@@ -30,8 +30,8 @@
       <view class="performance-ranking-search-item btn-item">
         <u-button text="搜索" size="small" class="custom-btn" type="primary" @click="handleQuery"></u-button>
         <u-button text="重置" size="small" class="custom-btn" @click="handleReset"></u-button>
-      </view>
-    </view> -->
+      </view> -->
+    </view>
     <view class="performance-ranking-content">
       <TableRanking
         :loading="tableData.loading"
@@ -62,8 +62,8 @@ export default {
         payeeNoList: undefined,
         beginTime: undefined,
         endTime: undefined,
-				sortField: 'realAmount',
-				sortOrder: 'desc',
+        sortField: 'realAmount',
+        sortOrder: 'desc',
         pageNum: 1,
         pageSize: 10
       },
@@ -77,11 +77,23 @@ export default {
           },
           {
             field: '姓名',
-            key: 'payeeName'
+            key: 'payeeName',
+            width: 80
           },
           {
             field: '实收金额(元)',
-            key: 'realAmount'
+            key: 'realAmount',
+            width: 100
+          },
+          {
+            field: '追缴现金金额(元)',
+            key: 'pursueCashAmt',
+            width: 100
+          },
+          {
+            field: '追缴非现金金额(元)',
+            key: 'pursueOtherAmt',
+            width: 100
           }
         ],
         tableData: {
@@ -93,6 +105,8 @@ export default {
   },
   onShow() {
     // this.getCollectorList();
+    const today = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd');
+    this.dateRange = [today, today];
     this.getList();
   },
   methods: {
@@ -102,33 +116,32 @@ export default {
      * @returns {any}
      */
     getCollectorList() {
-      uni.$u.api.tollCollectorPerformanceApi
-        .getAllTollCollectorApi()
-        .then((res) => {
-          const { code, rows } = res;
-          if (code === 200) {
-            this.collectorList = rows.map((item) => {
-              return { id: item.payeeNo, value: item.payeeName };
-            });
-            this.loadAcheve = true;
-          }
-        });
+      uni.$u.api.tollCollectorPerformanceApi.getAllTollCollectorApi().then((res) => {
+        const { code, rows } = res;
+        if (code === 200) {
+          this.collectorList = rows.map((item) => {
+            return { id: item.payeeNo, value: item.payeeName };
+          });
+          this.loadAcheve = true;
+        }
+      });
     },
     /**
      * 获取数据
      */
     getList() {
       this.tableData.loading = true;
-      uni.$u.api.statisticalReportApi
-        .getTollCollectorAchieveListApi({ ...this.params })
-        .then((res) => {
-          const { code, rows, total } = res;
-          if (code === 200) {
-            this.tableData.tableData.list = rows;
-            this.tableData.tableData.total = total;
-          }
-          this.tableData.loading = false;
-        });
+      if (this.dateRange.length) (this.params.beginTime = this.dateRange[0]), (this.params.endTime = this.dateRange[1]);
+      uni.$u.api.statisticalReportApi.getTollCollectorAchieveListApi({ ...this.params }).then((res) => {
+        const { code, rows, total } = res;
+        if (code === 200) {
+          this.tableData.tableData.list = rows.map((item) => {
+            return { ...item, pursueAmt: item.pursueOtherAmt + item.pursueCashAmt };
+          });
+          this.tableData.tableData.total = total;
+        }
+        this.tableData.loading = false;
+      });
     },
     handleQuery() {
       this.getList();
@@ -164,6 +177,7 @@ export default {
     dateChange(e) {
       this.params.beginTime = e[0];
       this.params.endTime = e[1];
+      this.getList();
     },
     /**
      * 分页触发
@@ -177,10 +191,10 @@ export default {
 };
 </script>
 <style lang="scss">
-	page {
-	  background-color: #1767f2;
-	  min-height: calc(100vh - 44px);
-	}
+page {
+  background-color: #1767f2;
+  min-height: calc(100vh - 44px);
+}
 </style>
 <style lang="scss" scoped>
 @import './performanceRanking.scss';

+ 16 - 16
pages/index/index.vue

@@ -184,22 +184,22 @@ export default {
           height: '33px',
           width: '33px'
         },
-        {
-          icon: require('@/static/icons/assessment-ranking-icon.svg'),
-          name: '考核排名',
-          url: 'pages/collectorManagement/assessmentRanking/assessmentRanking',
-          height: '33px',
-          width: '33px',
-          flag: true
-        },
-        {
-          icon: require('@/static/icons/assessment-analysis-icon.svg'),
-          name: '考核分析',
-          url: 'pages/collectorManagement/assessmentAnalysis/assessmentAnalysis',
-          height: '32px',
-          width: '33px',
-          flag: true
-        },
+        // {
+        //   icon: require('@/static/icons/assessment-ranking-icon.svg'),
+        //   name: '考核排名',
+        //   url: 'pages/collectorManagement/assessmentRanking/assessmentRanking',
+        //   height: '33px',
+        //   width: '33px',
+        //   flag: true
+        // },
+        // {
+        //   icon: require('@/static/icons/assessment-analysis-icon.svg'),
+        //   name: '考核分析',
+        //   url: 'pages/collectorManagement/assessmentAnalysis/assessmentAnalysis',
+        //   height: '32px',
+        //   width: '33px',
+        //   flag: true
+        // },
         {
           icon: require('@/static/icons/shift-scheduling-icon.svg'),
           name: '排班情况',

+ 5 - 3
pages/operationalAnalysis/parkModel/index.vue

@@ -3,7 +3,7 @@
  * @Author: 空白格
  * @Date: 2022-08-02 15:32:15
  * @LastEditors: 空白格
- * @LastEditTime: 2022-08-04 11:43:11
+ * @LastEditTime: 2022-11-16 12:00:34
  * @FilePath: \parking_operation\pages\operationalAnalysis\parkModel\index.vue
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved. 
 -->
@@ -161,9 +161,11 @@ export default {
   methods: {
     defaultSetVal() {
       this.currentYear = this.yearList[0][4].value;
-      this.title = this.yearList[0][4].text;
+      this.title = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd');
       this.yearObj = this.yearList[0][4];
-      this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`;
+      this.tabCur = 0;
+      this.params.reportType = 0;
+      this.params.queryDate = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd');;
       this.$nextTick(() => {
         this.$refs[this.templateKey].getData(this.params);
       });

+ 11 - 37
pages/operationalAnalysis/roadModel/index.vue

@@ -3,7 +3,7 @@
  * @Author: 空白格
  * @Date: 2022-08-02 16:47:29
  * @LastEditors: 空白格
- * @LastEditTime: 2022-08-04 11:43:21
+ * @LastEditTime: 2022-11-16 10:45:17
  * @FilePath: \parking_operation\pages\operationalAnalysis\roadModel\index.vue
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved. 
 -->
@@ -12,16 +12,8 @@
     <view class="analysis-header">
       <view class="analysis-header-left">
         <view class="tab">
-          <view
-            class="tab-item"
-            v-for="(item, index) in tabList"
-            :key="index"
-            :class="{ active: tabCur === item.value }"
-            @click="tabClick(item)"
-          >
-            {{
-            item.label
-            }}
+          <view class="tab-item" v-for="(item, index) in tabList" :key="index" :class="{ active: tabCur === item.value }" @click="tabClick(item)">
+            {{ item.label }}
           </view>
         </view>
       </view>
@@ -45,29 +37,11 @@
       </template>
     </view>
     <!-- 年 -->
-    <u-picker
-      :show="yearPicker"
-      :columns="yearList"
-      :defaultIndex="defaultYear"
-      @confirm="yearConfirm"
-      @cancel="yearPicker = false"
-    />
+    <u-picker :show="yearPicker" :columns="yearList" :defaultIndex="defaultYear" @confirm="yearConfirm" @cancel="yearPicker = false" />
     <!-- 月 -->
-    <u-picker
-      :show="monthPicker"
-      :columns="monthList"
-      :defaultIndex="defaultMonth"
-      @confirm="monthConfirm"
-      @cancel="monthPicker = false"
-    />
+    <u-picker :show="monthPicker" :columns="monthList" :defaultIndex="defaultMonth" @confirm="monthConfirm" @cancel="monthPicker = false" />
     <!-- 日 -->
-    <u-picker
-      :show="dayPicker"
-      :columns="dayList"
-      :defaultIndex="defaultDay"
-      @confirm="dayConfirm"
-      @cancel="dayPicker = false"
-    />
+    <u-picker :show="dayPicker" :columns="dayList" :defaultIndex="defaultDay" @confirm="dayConfirm" @cancel="dayPicker = false" />
   </view>
 </template>
 
@@ -136,9 +110,7 @@ export default {
         const dateArr = val.split('-');
         switch (this.tabCur) {
           case 0:
-            this.currentDate = `${Number(dateArr[0])}年${Number(
-              dateArr[1]
-            )}月${Number(dateArr[2])}日`;
+            this.currentDate = `${Number(dateArr[0])}年${Number(dateArr[1])}月${Number(dateArr[2])}日`;
             break;
           case 1:
             this.currentDate = `${Number(dateArr[0])}年${Number(dateArr[1])}月`;
@@ -165,9 +137,11 @@ export default {
   methods: {
     defaultSetVal() {
       this.currentYear = this.yearList[0][4].value;
-      this.title = this.yearList[0][4].text;
+      this.title = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd');
       this.yearObj = this.yearList[0][4];
-      this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`;
+      this.tabCur = 0;
+      this.params.reportType = 0;
+      this.params.queryDate = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd');;
       this.$nextTick(() => {
         this.$refs[this.templateKey].getData(this.params);
       });

+ 0 - 62
pages/patrolManagement/deviceAbnormalRecords copy/deviceAbnormalRecords.scss

@@ -1,62 +0,0 @@
-.records {
-	padding: 10px 15px;
-	font-family: PingFangSC-Regular, PingFang SC;
-	&-list {
-		&-item {
-			background-color: #fff;
-			border-radius: 5px;
-			padding: 12px 15px;
-			margin-bottom: 10px;
-			&-header {
-				display: flex;
-				justify-content: space-between;
-				color: #171717;
-				font-size: 18px;
-				margin-bottom: 12px;
-				view:last-child {
-					color: #1767F2;
-					font-size: 15px;
-				}
-				.not-red {
-					position: relative;
-					&::after {
-						content: '';
-						position: absolute;
-						top: 10px;
-						right: -15px;
-						width: 7px;
-						height: 7px;
-						background-color: #f00;
-						border-radius: 50%;
-					}
-				}
-			}
-			&-content {
-				color: #616161;
-				font-size: 12px;
-				line-height: 17px;
-				padding-bottom: 8px;
-				border-bottom: solid 1px #DBDBDB;
-				view {
-					overflow: hidden;
-					text-overflow: ellipsis;
-					display: -webkit-box;
-					-webkit-line-clamp: 3;
-					-webkit-box-orient: vertical;
-				}
-			}
-			&-bottom {
-				display: flex;
-				justify-content: space-between;
-				color: #767676;
-				font-size: 12px;
-				margin-top: 8px;
-			}
-		}
-	}
-	&-empty {
-		background-color: #fff;
-		padding: 15px;
-		border-radius: 5px;
-	}
-}

+ 0 - 90
pages/patrolManagement/deviceAbnormalRecords copy/deviceAbnormalRecords.vue

@@ -1,90 +0,0 @@
-<!-- 设备异常记录 -->
-<template>
-	<view class="records">
-		<view class="records-list" v-if="recordList.length">
-			<view class="records-list-item" v-for="(item, index) in recordList" :key="index" @click="recordClick(item)">
-				<view class="records-list-item-header">
-					<view :class="{'not-red': Number(item.isRed) === 0}">{{ item.roadName }}</view>
-					<view>{{ item.createBy }}</view>
-				</view>
-				<view class="records-list-item-content">
-					<view>{{ item.exceprionDes }}</view>
-				</view>
-				<view class="records-list-item-bottom">
-					<view>{{ $u.timeFormat(item.createTime, 'mm-dd hh:MM') }}</view>
-					<view>查看详情</view>
-				</view>
-			</view>
-		</view>
-		<view class="records-empty" v-else>
-			<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png" />
-		</view>
-		<u-loadmore v-if="recordList.length" :status="status" color="#fff" />
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				recordList: [],
-				status: 'loadmore',
-				page: 1,
-			}
-		},
-		onShow() {
-			this.page = 1
-			this.recordList = []
-			this.getRecordList();
-		},
-		methods: {
-			getRecordList() {
-				uni.$u.api.deviceAbnormalApi.getDeviceAbnormalListApi({
-					pageNum: this.page,
-					pageSize: 15
-				}).then(res => {
-					if (res.code === 200) {
-						this.recordList = this.recordList.concat(res.data.rows)
-						setTimeout(() => {
-							if (this.page >= res.data.pages) this.status = 'nomore';
-							else this.status = 'loading';
-						}, 1000)
-					}
-				})
-			},
-			recordClick(item) {
-				uni.$u.route({
-					url: 'pages/patrolManagement/deviceAbnormalRecords/recordsDetails/recordsDetails',
-					params: {
-						id: item.id
-					}
-				})
-			}
-		},
-		onPullDownRefresh() {
-			this.recordList = []
-			this.page = 1;
-			this.status = 'loading';
-			this.getRecordList();
-			setTimeout(function() {
-				uni.stopPullDownRefresh();
-			}, 1000);
-		},
-		onReachBottom() {
-			if (this.page >= 100) return;
-			this.status = 'loading';
-			this.page = ++this.page;
-			this.getRecordList()
-		}
-	}
-</script>
-
-<style lang="scss">
-	page {
-		min-height: calc(100vh - 44px);
-		background-color: #1767F2;
-	}
-</style>
-<style lang="scss" scoped>
-	@import './deviceAbnormalRecords.scss';
-</style>

+ 0 - 45
pages/patrolManagement/deviceAbnormalRecords copy/recordsDetails/recordsDetails.scss

@@ -1,45 +0,0 @@
-.details {
-	padding: 15px;
-	&-content {
-		background-color: #fff;
-		border-radius: 5px;
-		padding: 15px;
-		font-family: PingFangSC-Regular, PingFang SC;
-		&-road {
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			margin-bottom: 12px;
-			&-name {
-				font-size: 19px;
-				color: #171717;
-			}
-			&-date {
-				color: #767676;
-				font-size: 13px;
-			}
-		}
-		&-describe {
-			color: #616161;
-			font-size: 13px;
-		}
-		&-imgs {
-			margin-top: 11px;
-			display: flex;
-			flex-wrap: wrap;
-			&-item {
-				border: solid 1px #f1efef;
-				margin-right: 20px;
-				margin-bottom: 11px;
-				width: calc(50% - 12px);
-				&:nth-child(2n) {
-					margin-right: 0;
-				}
-				image {
-					width: 100%;
-					height: 30vw;
-				}
-			}
-		}
-	}
-}

+ 0 - 96
pages/patrolManagement/deviceAbnormalRecords copy/recordsDetails/recordsDetails.vue

@@ -1,96 +0,0 @@
-<template>
-	<view class="details">
-		<!-- <u-loading-page :loading="loading"></u-loading-page> -->
-		<view class="details-content" v-if="detailsInfo.id">
-			<view class="details-content-road">
-				<view class="details-content-road-name">{{ detailsInfo.roadName }}</view>
-				<view class="details-content-road-date">{{ detailsInfo.createTime }}</view>
-			</view>
-			<view class="details-content-describe">
-				{{ detailsInfo.exceprionDes }}
-			</view>
-			<view class="details-content-imgs" v-if="detailsInfo.imgsList && detailsInfo.imgsList.length">
-				<view class="details-content-imgs-item" v-for="(img, index) in detailsInfo.imgsList" :key="index">
-					<image :src="img" mode="aspectFit" @click="previewImage(detailsInfo.imgsList, index)"/>
-				</view>
-			</view>
-		</view>
-		<view class="details-content" v-else>
-			<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				id: undefined,
-				detailsInfo: {},
-				loading: false
-			}
-		},
-		onLoad(page) {
-			this.id = page.id
-		},
-		onShow() {
-			if (this.id) {
-				this.getDetails(this.id)
-			}
-		},
-		methods: {
-			getDetails(id) {
-				this.loading = true
-				uni.$u.api.deviceAbnormalApi.getDeviceAbnormalDetailsApi({
-					id
-				}).then(res => {
-					if (res.code === 200) {
-						this.detailsInfo = res.data
-						if (this.detailsInfo.imgs) {
-							this.detailsInfo.imgsList = this.detailsInfo.imgs.split(';')
-						}
-						if (this.detailsInfo.isRed === 0) {
-							this.updateDeviceAbnormalInfo(this.id);
-						}
-					}
-					this.loading = false
-				}).catch(e => {
-					this.loading = false
-				})
-			},
-			/**
-			 * 设置消息已读
-			 * @param { String } id
-			 */
-			updateDeviceAbnormalInfo(id) {
-				uni.$u.api.deviceAbnormalApi.updateDeviceAbnormalInfoApi({
-					id
-				}).then(res => {
-					console.log('已读:', id)
-				})
-			},
-			/**
-			 * 预览图片
-			 * @param { Array } list
-			 * @param { Number } current
-			 */
-			previewImage(list, current = 0) {
-				uni.previewImage({
-					urls: list,
-					current
-				});
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	page {
-		min-height: calc(100vh - 44px);
-		background-color: #1767F2;
-	}
-</style>
-
-<style lang="scss" scoped>
-	@import './recordsDetails.scss';
-</style>

+ 1 - 1
pages/patrolManagement/emergencyDisposalRecords/emergencyDisposalRecords.vue

@@ -3,7 +3,7 @@
  * @Author: 空白格
  * @Date: 2022-08-01 09:27:24
  * @LastEditors: 空白格
- * @LastEditTime: 2022-08-23 11:22:02
+ * @LastEditTime: 2022-11-16 11:41:03
  * @FilePath: \parking_operation\pages\patrolManagement\emergencyDisposalRecords\emergencyDisposalRecords.vue
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved. 
 -->

+ 97 - 104
pages/statisticalReport/parkModel/components/reallyReceivable.vue

@@ -1,113 +1,106 @@
 <!-- 应收实收分析 -->
 <template>
-	<view class="container">
-		<view class="table">
-			<!-- <view class="table-date" v-if="params.queryDate">{{ params.title }}</view> -->
-			<view class="table-box">
-				<uni-table emptyText="暂无更多数据" :loading="loading">
-					<!-- 表头行 -->
-					<uni-tr>
-						<uni-th class="table-box-th" align="center" v-for="(item, index) in tableTh" :key="index"
-							:width="item.width || ''">{{ item.field }}
-						</uni-th>
-					</uni-tr>
-					<!-- 表格数据行 -->
-					<uni-tr v-for="(item, index) in tableData.list" :key="index">
-						<uni-td class="table-box-td" align="center" v-for="(field, fIndex) in tableTh" :key="fIndex">
-							{{ item[field.key] }}</uni-td>
-					</uni-tr>
-				</uni-table>
-			</view>
-		</view>
-	</view>
+  <view class="container">
+    <view class="table">
+      <!-- <view class="table-date" v-if="params.queryDate">{{ params.title }}</view> -->
+      <view class="table-box">
+        <TableRanking :loading="loading" :tableTh="tableTh" :tableData="tableData" padding="0" :isScroll="true" />
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default {
-		props: {
-			tableTh: {
-				type: Array,
-				default: () => {
-					return [{
-							field: '时间',
-							width: 120,
-							key: 'statisTime'
-						},
-						{
-							field: '应收金额(元)',
-							width: 80,
-							key: 'payAmount'
-						},
-						{
-							field: '实收金额(元)',
-							width: 80,
-							key: 'realAmount'
-						},
-						{
-							field: '逃费金额(元)',
-							width: 80,
-							key: 'runawayAmount'
-						},
-						{
-							field: `“一分钱停车”减免`,
-							width: 120,
-							key: 'oneAmount'
-						},
-						{
-							field: '“八折停车”减免',
-							width: 110,
-							key: 'eightAmount'
-						},
-						{
-							field: '欠费金额(元)',
-							width: 80,
-							key: 'amtOwe'
-						},
-						{
-							field: '退款金额(元)',
-							width: 80,
-							key: 'backAmount'
-						}
-					]
-				}
-			}
-		},
-		data() {
-			return {
-				currentDate: [],
-				tableData: {
-					list: []
-				},
-				params: {
-					reportType: 2,
-					queryDate: '',
-					title: ''
-				},
-				loading: false
-			}
-		},
-		methods: {
-			tabClick(item) {
-				this.tabCurName = item.value
-				this.getReallyReceivableList()
-			},
-			getData(obj) {
-				this.params = obj
-				this.getReallyReceivableList()
-			},
-			getReallyReceivableList() {
-				this.loading = true
-				uni.$u.api.statisticalReportApi.getParkingReallyReceivableListApi(this.params).then(res => {
-					if (res.code === 200) {
-						this.tableData.list = res.data.itemList
-					}
-					this.loading = false
-				})
-			}
-		}
-	}
+import TableRanking from '@/components/tableRanking.vue';
+export default {
+	components: {
+    TableRanking
+  },
+  props: {
+    tableTh: {
+      type: Array,
+      default: () => {
+        return [
+          {
+            field: '时间',
+            width: 130,
+            key: 'statisTime'
+          },
+          {
+            field: '应收金额(元)',
+            width: 80,
+            key: 'payAmount'
+          },
+          {
+            field: '实收金额(元)',
+            width: 80,
+            key: 'realAmount'
+          },
+          {
+            field: '逃费金额(元)',
+            width: 80,
+            key: 'runawayAmount'
+          },
+          {
+            field: `“一分钱停车”减免`,
+            width: 120,
+            key: 'oneAmount'
+          },
+          {
+            field: '“八折停车”减免',
+            width: 110,
+            key: 'eightAmount'
+          },
+          {
+            field: '欠费金额(元)',
+            width: 80,
+            key: 'amtOwe'
+          },
+          {
+            field: '退款金额(元)',
+            width: 80,
+            key: 'backAmount'
+          }
+        ];
+      }
+    }
+  },
+  data() {
+    return {
+      currentDate: [],
+      tableData: {
+        list: []
+      },
+      params: {
+        reportType: 2,
+        queryDate: '',
+        title: ''
+      },
+      loading: false
+    };
+  },
+  methods: {
+    tabClick(item) {
+      this.tabCurName = item.value;
+      this.getReallyReceivableList();
+    },
+    getData(obj) {
+      this.params = obj;
+      this.getReallyReceivableList();
+    },
+    getReallyReceivableList() {
+      this.loading = true;
+      uni.$u.api.statisticalReportApi.getParkingReallyReceivableListApi(this.params).then((res) => {
+        if (res.code === 200) {
+          this.tableData.list = res.data.itemList;
+        }
+        this.loading = false;
+      });
+    }
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-	@import './../../styles/report.scss';
+@import './../../styles/report.scss';
 </style>

+ 27 - 48
pages/statisticalReport/parkModel/index.vue

@@ -3,7 +3,7 @@
  * @Author: 空白格
  * @Date: 2022-08-03 11:55:13
  * @LastEditors: 空白格
- * @LastEditTime: 2022-08-04 11:42:48
+ * @LastEditTime: 2022-11-16 09:38:11
  * @FilePath: \parking_operation\pages\statisticalReport\parkModel\index.vue
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved. 
 -->
@@ -13,13 +13,9 @@
       <view class="report-header-left">
         <template v-if="templateKey === 'reallyReceivable'">
           <view class="tab">
-            <view
-              class="tab-item"
-              v-for="(item, index) in tabList"
-              :key="index"
-              :class="{'active': tabCur === item.value}"
-              @click="tabClick(item)"
-            >{{ item.label }}</view>
+            <view class="tab-item" v-for="(item, index) in tabList" :key="index" :class="{ active: tabCur === item.value }" @click="tabClick(item)">{{
+              item.label
+            }}</view>
           </view>
         </template>
         <template v-else>
@@ -45,29 +41,11 @@
       </template>
     </view>
     <!-- 年 -->
-    <u-picker
-      :show="yearPicker"
-      :columns="yearList"
-      :defaultIndex="defaultYear"
-      @confirm="yearConfirm"
-      @cancel="yearPicker = false"
-    />
+    <u-picker :show="yearPicker" :columns="yearList" :defaultIndex="defaultYear" @confirm="yearConfirm" @cancel="yearPicker = false" />
     <!-- 月 -->
-    <u-picker
-      :show="monthPicker"
-      :columns="monthList"
-      :defaultIndex="defaultMonth"
-      @confirm="monthConfirm"
-      @cancel="monthPicker = false"
-    />
+    <u-picker :show="monthPicker" :columns="monthList" :defaultIndex="defaultMonth" @confirm="monthConfirm" @cancel="monthPicker = false" />
     <!-- 日 -->
-    <u-picker
-      :show="dayPicker"
-      :columns="dayList"
-      :defaultIndex="defaultDay"
-      @confirm="dayConfirm"
-      @cancel="dayPicker = false"
-    />
+    <u-picker :show="dayPicker" :columns="dayList" :defaultIndex="defaultDay" @confirm="dayConfirm" @cancel="dayPicker = false" />
   </view>
 </template>
 
@@ -137,9 +115,7 @@ export default {
           if (val.length) {
             let startDateList = val[0].split('-'),
               endDateList = val[1].split('-');
-            this.currentDate = `${Number(startDateList[0])}年${Number(
-              startDateList[1]
-            )}月${Number(startDateList[2])}日至${Number(
+            this.currentDate = `${Number(startDateList[0])}年${Number(startDateList[1])}月${Number(startDateList[2])}日至${Number(
               endDateList[0]
             )}年${Number(endDateList[1])}月${Number(endDateList[2])}日`;
           }
@@ -147,14 +123,10 @@ export default {
           const dateArr = val.split('-');
           switch (this.tabCur) {
             case 0:
-              this.currentDate = `${Number(dateArr[0])}年${Number(
-                dateArr[1]
-              )}月${Number(dateArr[2])}日`;
+              this.currentDate = `${Number(dateArr[0])}年${Number(dateArr[1])}月${Number(dateArr[2])}日`;
               break;
             case 1:
-              this.currentDate = `${Number(dateArr[0])}年${Number(
-                dateArr[1]
-              )}月`;
+              this.currentDate = `${Number(dateArr[0])}年${Number(dateArr[1])}月`;
               break;
             case 2:
               this.currentDate = `${Number(dateArr[0])}年`;
@@ -174,21 +146,28 @@ export default {
     this.templateKey = options.key;
   },
   onShow() {
-    if (
-      this.templateKey === 'revenueReport' ||
-      this.templateKey === 'reallyReceivable'
-    ) {
-      let today = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd');
-      this.curDate = [today, today];
-    } else {
-      this.curDate = [];
-    }
+    let today = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd');
+    this.curDate = [today, today];
+    // if (
+    //   this.templateKey === 'revenueReport' ||
+    //   this.templateKey === 'reallyReceivable'
+    // ) {
+    //   let today = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd');
+    //   this.curDate = [today, today];
+    // } else {
+    //   this.curDate = [];
+    // }
     this.$nextTick(() => {
       if (this.templateKey === 'reallyReceivable') {
+        this.tabCur = 0;
+        this.params.reportType = 0;
         this.currentYear = this.yearList[0][4].value;
         this.yearObj = this.yearList[0][4];
-        this.title = this.yearList[0][4].text;
+        this.currentMonth = uni.$u.timeFormat(new Date(), 'mm');
+        this.currentDay = uni.$u.timeFormat(new Date(), 'dd');
         this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`;
+        const dateArr = this.params.queryDate.split('-');
+        this.currentDate = `${Number(dateArr[0])}年${Number(dateArr[1])}月${Number(dateArr[2])}日`;
         this.$refs[this.templateKey].getData(this.params);
       } else {
         this.title = this.curDate;

+ 96 - 104
pages/statisticalReport/roadModel/components/reallyReceivable.vue

@@ -1,113 +1,105 @@
 <!-- 应收实收分析 -->
 <template>
-	<view class="container">
-		<view class="table">
-			<!-- <view class="table-date" v-if="params.queryDate">{{ params.title }}</view> -->
-			<view class="table-box">
-				<uni-table emptyText="暂无更多数据" :loading="loading">
-					<!-- 表头行 -->
-					<uni-tr>
-						<uni-th class="table-box-th" align="center" v-for="(item, index) in tableTh" :key="index"
-							:width="item.width || ''">{{ item.field }}
-						</uni-th>
-					</uni-tr>
-					<!-- 表格数据行 -->
-					<uni-tr v-for="(item, index) in tableData.list" :key="index">
-						<uni-td class="table-box-td" align="center" v-for="(field, fIndex) in tableTh" :key="fIndex">
-							{{ item[field.key] }}</uni-td>
-					</uni-tr>
-				</uni-table>
-			</view>
-		</view>
-	</view>
+  <view class="container">
+    <view class="table">
+      <view class="table-box">
+        <TableRanking :loading="loading" :tableTh="tableTh" :tableData="tableData" padding="0" :isScroll="true" />
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default {
-		props: {
-			tableTh: {
-				type: Array,
-				default: () => {
-					return [{
-							field: '时间',
-							width: 120,
-							key: 'statisTime'
-						},
-						{
-							field: '应收金额(元)',
-							width: 80,
-							key: 'payAmount'
-						},
-						{
-							field: '实收金额(元)',
-							width: 80,
-							key: 'realAmount'
-						},
-						{
-							field: '逃费金额(元)',
-							width: 80,
-							key: 'runawayAmount'
-						},
-						{
-							field: `“一分钱停车”减免`,
-							width: 120,
-							key: 'oneAmount'
-						},
-						{
-							field: '“八折停车”减免',
-							width: 110,
-							key: 'eightAmount'
-						},
-						{
-							field: '欠费金额(元)',
-							width: 80,
-							key: 'amtOwe'
-						},
-						{
-							field: '退款金额(元)',
-							width: 80,
-							key: 'backAmount'
-						}
-					]
-				}
-			}
-		},
-		data() {
-			return {
-				currentDate: [],
-				tableData: {
-					list: []
-				},
-				params: {
-					reportType: 2,
-					queryDate: '',
-					title: ''
-				},
-				loading: false
-			}
-		},
-		methods: {
-			tabClick(item) {
-				this.tabCurName = item.value
-				this.getReallyReceivableList()
-			},
-			getData(obj) {
-				this.params = obj
-				this.getReallyReceivableList()
-			},
-			getReallyReceivableList() {
-				this.loading = true
-				uni.$u.api.statisticalReportApi.getReallyReceivableListApi(this.params).then(res => {
-					if (res.code === 200) {
-						this.tableData.list = res.data.itemList
-					}
-					this.loading = false
-				})
-			}
-		}
-	}
+import TableRanking from '@/components/tableRanking.vue';
+export default {
+  components: {
+    TableRanking
+  },
+  props: {
+    tableTh: {
+      type: Array,
+      default: () => {
+        return [
+          {
+            field: '时间',
+            width: 130,
+            key: 'statisTime'
+          },
+          {
+            field: '应收金额(元)',
+            width: 80,
+            key: 'payAmount'
+          },
+          {
+            field: '实收金额(元)',
+            width: 80,
+            key: 'realAmount'
+          },
+          {
+            field: '逃费金额(元)',
+            width: 80,
+            key: 'runawayAmount'
+          },
+          {
+            field: `“一分钱停车”减免`,
+            width: 120,
+            key: 'oneAmount'
+          },
+          {
+            field: '“八折停车”减免',
+            width: 110,
+            key: 'eightAmount'
+          },
+          {
+            field: '欠费金额(元)',
+            width: 80,
+            key: 'amtOwe'
+          },
+          {
+            field: '退款金额(元)',
+            width: 80,
+            key: 'backAmount'
+          }
+        ];
+      }
+    }
+  },
+  data() {
+    return {
+      currentDate: [],
+      tableData: {
+        list: []
+      },
+      params: {
+        reportType: 2,
+        queryDate: '',
+        title: ''
+      },
+      loading: false
+    };
+  },
+  methods: {
+    tabClick(item) {
+      this.tabCurName = item.value;
+      this.getReallyReceivableList();
+    },
+    getData(obj) {
+      this.params = obj;
+      this.getReallyReceivableList();
+    },
+    getReallyReceivableList() {
+      this.loading = true;
+      uni.$u.api.statisticalReportApi.getReallyReceivableListApi(this.params).then((res) => {
+        if (res.code === 200) {
+          this.tableData.list = res.data.itemList;
+        }
+        this.loading = false;
+      });
+    }
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-	@import './../../styles/report.scss';
+@import './../../styles/report.scss';
 </style>

+ 26 - 48
pages/statisticalReport/roadModel/index.vue

@@ -3,7 +3,7 @@
  * @Author: 空白格
  * @Date: 2022-08-03 09:26:29
  * @LastEditors: 空白格
- * @LastEditTime: 2022-08-04 11:42:40
+ * @LastEditTime: 2022-11-16 09:38:19
  * @FilePath: \parking_operation\pages\statisticalReport\roadModel\index.vue
  * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved. 
 -->
@@ -14,13 +14,9 @@
       <view class="report-header-left">
         <template v-if="templateKey === 'reallyReceivable'">
           <view class="tab">
-            <view
-              class="tab-item"
-              v-for="(item, index) in tabList"
-              :key="index"
-              :class="{'active': tabCur === item.value}"
-              @click="tabClick(item)"
-            >{{ item.label }}</view>
+            <view class="tab-item" v-for="(item, index) in tabList" :key="index" :class="{ active: tabCur === item.value }" @click="tabClick(item)">{{
+              item.label
+            }}</view>
           </view>
         </template>
         <template v-else>
@@ -49,29 +45,11 @@
       </template>
     </view>
     <!-- 年 -->
-    <u-picker
-      :show="yearPicker"
-      :columns="yearList"
-      :defaultIndex="defaultYear"
-      @confirm="yearConfirm"
-      @cancel="yearPicker = false"
-    />
+    <u-picker :show="yearPicker" :columns="yearList" :defaultIndex="defaultYear" @confirm="yearConfirm" @cancel="yearPicker = false" />
     <!-- 月 -->
-    <u-picker
-      :show="monthPicker"
-      :columns="monthList"
-      :defaultIndex="defaultMonth"
-      @confirm="monthConfirm"
-      @cancel="monthPicker = false"
-    />
+    <u-picker :show="monthPicker" :columns="monthList" :defaultIndex="defaultMonth" @confirm="monthConfirm" @cancel="monthPicker = false" />
     <!-- 日 -->
-    <u-picker
-      :show="dayPicker"
-      :columns="dayList"
-      :defaultIndex="defaultDay"
-      @confirm="dayConfirm"
-      @cancel="dayPicker = false"
-    />
+    <u-picker :show="dayPicker" :columns="dayList" :defaultIndex="defaultDay" @confirm="dayConfirm" @cancel="dayPicker = false" />
   </view>
 </template>
 
@@ -143,9 +121,7 @@ export default {
           if (val.length) {
             let startDateList = val[0].split('-'),
               endDateList = val[1].split('-');
-            this.currentDate = `${Number(startDateList[0])}年${Number(
-              startDateList[1]
-            )}月${Number(startDateList[2])}日至${Number(
+            this.currentDate = `${Number(startDateList[0])}年${Number(startDateList[1])}月${Number(startDateList[2])}日至${Number(
               endDateList[0]
             )}年${Number(endDateList[1])}月${Number(endDateList[2])}日`;
           }
@@ -153,14 +129,10 @@ export default {
           const dateArr = val.split('-');
           switch (this.tabCur) {
             case 0:
-              this.currentDate = `${Number(dateArr[0])}年${Number(
-                dateArr[1]
-              )}月${Number(dateArr[2])}日`;
+              this.currentDate = `${Number(dateArr[0])}年${Number(dateArr[1])}月${Number(dateArr[2])}日`;
               break;
             case 1:
-              this.currentDate = `${Number(dateArr[0])}年${Number(
-                dateArr[1]
-              )}月`;
+              this.currentDate = `${Number(dateArr[0])}年${Number(dateArr[1])}月`;
               break;
             case 2:
               this.currentDate = `${Number(dateArr[0])}年`;
@@ -180,21 +152,27 @@ export default {
     this.templateKey = options.key;
   },
   onShow() {
-    if (
-      this.templateKey === 'revenueReport' ||
-      this.templateKey === 'reallyReceivable'
-    ) {
-      let today = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd');
-      this.curDate = [today, today];
-    } else {
-      this.curDate = [];
-    }
+    let today = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd');
+    this.curDate = [today, today];
+    // if (
+    //   this.templateKey === 'revenueReport' ||
+    //   this.templateKey === 'reallyReceivable'
+    // ) {
+    //   this.curDate = [today, today];
+    // } else {
+    //   this.curDate = [today, today];
+    // }
     this.$nextTick(() => {
       if (this.templateKey === 'reallyReceivable') {
+        this.tabCur = 0;
+        this.params.reportType = 0;
         this.currentYear = this.yearList[0][4].value;
         this.yearObj = this.yearList[0][4];
-        this.title = this.yearList[0][4].text;
+        this.currentMonth = uni.$u.timeFormat(new Date(), 'mm');
+        this.currentDay = uni.$u.timeFormat(new Date(), 'dd');
         this.params.queryDate = `${this.currentYear}-${this.currentMonth}-${this.currentDay}`;
+        const dateArr = this.params.queryDate.split('-');
+        this.currentDate = `${Number(dateArr[0])}年${Number(dateArr[1])}月${Number(dateArr[2])}日`;
         this.$refs[this.templateKey].getData(this.params);
       } else {
         this.title = this.curDate;