From fb814a1ea0062a8ac3b1c60d0d22e20e3fa3ee11 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期四, 04 六月 2026 09:50:36 +0800
Subject: [PATCH] 1.app生产报工新增 本季度 上一季度的时间过滤
---
components/page-nav/page-nav.vue | 3
pages/scgl/scbg.vue | 103 ++++++++++++++++++++++++++++++++-
main.js | 14 ++++
pages/mjgl/mjcx2.vue | 4
4 files changed, 114 insertions(+), 10 deletions(-)
diff --git a/components/page-nav/page-nav.vue b/components/page-nav/page-nav.vue
index 6877c3f..3600a7c 100644
--- a/components/page-nav/page-nav.vue
+++ b/components/page-nav/page-nav.vue
@@ -1,7 +1,8 @@
<template>
<view>
<!-- :style="{height:($DeviceInformation.screenHeight/12)+'rpx'}" -->
- <view class="headClass">鏂板嚡杩簯鍒堕��</view>
+ <!-- <view class="headClass">鏅鸿兘鍒堕�犱簯骞冲彴</view> -->
+ <view class="headClass">鏂板嚡杩簯骞冲彴</view>
<u-navbar :title="title" :fixed='false' :safeAreaInsetTop="false" titleStyle='color:#fff;letter-spacing: 2rpx;'
bgColor='#0066FF '>
<view class="u-nav-slot" slot="left">
diff --git a/main.js b/main.js
index dd3f74c..6d33de5 100644
--- a/main.js
+++ b/main.js
@@ -29,16 +29,26 @@
// Vue.prototype.$baseUrl = 'http://121.196.36.24:8039/api' //澶у矝椤圭洰锛�2.0锛�
// Vue.prototype.$baseUrl = 'http://192.168.2.138:8080/api' //澶у矝椤圭洰锛�2.0锛� 瀹㈡埛鐜板満瀹為檯鏈嶅姟鍣╥p
+// Vue.prototype.$baseUrl = 'http://192.168.2.138:9090/api' //澶у矝椤圭洰锛�2.0锛� 瀹㈡埛鐜板満瀹為檯鏈嶅姟鍣╥p 楠屾敹
-Vue.prototype.$baseUrl = 'http://192.168.0.32:8000/api' //涓婇潠椤圭洰 瀹㈡埛鐜板満瀹為檯鏈嶅姟鍣╥p
+Vue.prototype.$baseUrl = 'http://60.191.195.186:8989/api' //閲戦 瀹㈡埛鐜板満瀹為檯鏈嶅姟鍣╥p 澶栫綉
+// Vue.prototype.$baseUrl = 'http://121.196.36.24:8051/api' //閲戦 鍏徃浜�
+
+// Vue.prototype.$baseUrl = 'http://192.168.0.32:8000/api' //涓婇潠椤圭洰 瀹㈡埛鐜板満瀹為檯鏈嶅姟鍣╥p
// Vue.prototype.$baseUrl = 'http://121.196.36.24:9090/api' //鏈�鏂颁骇鍝� 2025/5/8
+// Vue.prototype.$baseUrl = 'http://121.196.36.24:8041/api' //娉颁赴 2026/1/4
+
+
+// Vue.prototype.$baseUrl = 'http://121.196.36.24:8048/api' //闃块瞾鍏� 2026/1/4
+// Vue.prototype.$baseUrl = 'http://192.168.21.19:8002/api' //闃块瞾鍏� 2026/1/4 8002 8003
-Vue.prototype.$companyType = 'C' //浼佷笟绫诲瀷锛堥」鐩被鍨嬶級 A锛氬法鍔涳紝B锛氬湥娌o紝銆丅: 浜у搧 锛孋:涓婇潠
+
+Vue.prototype.$companyType = 'B' //浼佷笟绫诲瀷锛堥」鐩被鍨嬶級 A锛氬法鍔涳紝B锛氬湥娌o紝銆丅: 浜у搧 锛孋:涓婇潠
// A: http://121.196.36.24:8021/api http://122.227.18.22:8000/api
// B: http://121.196.36.24:8032/api
diff --git a/pages/mjgl/mjcx2.vue b/pages/mjgl/mjcx2.vue
index 8f78fb3..6e98cb6 100644
--- a/pages/mjgl/mjcx2.vue
+++ b/pages/mjgl/mjcx2.vue
@@ -80,8 +80,8 @@
<view class="flex_column" style="width: 100%;">
<view style="display: flex;width: 100%;">
<view class="flex_column titleFont">
- <view>妯″叿缂栫爜锛�</view>
- <view>妯″叿鍚嶇О锛�</view>
+ <view>浜у搧缂栫爜锛�</view>
+ <view>浜у搧鍚嶇О锛�</view>
<view>瑙勬牸鍨嬪彿锛�</view>
</view>
<view class="flex_column contentFont">
diff --git a/pages/scgl/scbg.vue b/pages/scgl/scbg.vue
index f97185d..237490a 100644
--- a/pages/scgl/scbg.vue
+++ b/pages/scgl/scbg.vue
@@ -173,6 +173,17 @@
<u-button :plain='custom' style="width: 70px;height: 25px;" @click="dateChange('custom')"
type="primary" shape="circle" text="鑷畾涔�"></u-button>
</view>
+
+ <view class="head_block" style="height: 80rpx; display: flex;justify-content: space-around;">
+ <u-button :plain='currentQuarter' style="width: 70px;height: 25px;"
+ @click="dateChange('currentQuarter')" type="primary" shape="circle" text="鏈搴�">
+ </u-button>
+ <u-button :plain='lastQuarter' style="width: 70px;height: 25px;"
+ @click="dateChange('lastQuarter')" type="primary" shape="circle" text="涓婁竴瀛e害">
+ </u-button>
+
+ </view>
+
</view>
<view v-if="!custom" class="flex_column"
@@ -256,12 +267,14 @@
today: true,
month: false,
custom: true,
+ currentQuarter: true,
+ lastQuarter: true,
// calendarRange: new Date().toISOString().slice(0, 10) + '~' + new Date().toISOString().slice(0,
// 10), //绯荤粺褰撳墠鏃ユ湡
- calendarRange: new Date().getFullYear() + '-' + (new Date().getMonth() + 1).toString().padStart(
- 2, '0') + '-01' + '~' + new Date().toISOString().slice(0, 10), //褰撴湀鏃ユ湡
-
+ // calendarRange: new Date().getFullYear() + '-' + (new Date().getMonth() + 1).toString().padStart(
+ // 2, '0') + '-01' + '~' + new Date().toISOString().slice(0, 10), //褰撴湀鏃ユ湡
+ calendarRange: '',
tagArr: [
@@ -292,7 +305,7 @@
}
},
created() {
-
+ this.dateChange('currentQuarter')
},
mounted() {
this.init()
@@ -495,13 +508,16 @@
this.today = false
this.month = true
this.custom = true
+ this.currentQuarter = true
+ this.lastQuarter = true
this.calendarRange = new Date().toISOString().slice(0, 10) + '~' + new Date().toISOString().slice(0,
10)
} else if (val === 'month') {
this.today = true
this.month = false
this.custom = true
-
+ this.currentQuarter = true
+ this.lastQuarter = true
this.calendarRange = new Date().getFullYear() + '-' + (new Date().getMonth() + 1).toString().padStart(
2, '0') + '-01' + '~' + new Date().toISOString().slice(0, 10)
@@ -509,11 +525,88 @@
this.today = true
this.month = true
this.custom = false
+ this.currentQuarter = true
+ this.lastQuarter = true
this.calendarRange = new Date().getFullYear() + '-' + (new Date().getMonth() + 1).toString().padStart(
2, '0') + '-01' + '~' + new Date().toISOString().slice(0, 10)
+ } else if (val === 'currentQuarter') {
+ this.today = true
+ this.month = true
+ this.custom = true
+ this.currentQuarter = false
+ this.lastQuarter = true
+
+ this.calendarRange = this.getCurrentQuarter().start + '~' + this.getCurrentQuarter().end
+ } else if (val === 'lastQuarter') {
+ this.today = true
+ this.month = true
+ this.custom = true
+ this.currentQuarter = true
+ this.lastQuarter = false
+ this.calendarRange = this.getLastQuarter().start + '~' + this.getLastQuarter().end
+
}
},
+
+
+ // 鑾峰彇 鏈搴� 寮�濮嬨�佺粨鏉熸棩鏈�
+ getCurrentQuarter() {
+ const now = new Date()
+ const year = now.getFullYear()
+ const month = now.getMonth() // 0-11
+
+ // 褰撳墠瀛e害
+ const quarter = Math.floor(month / 3)
+ const startMonth = quarter * 3
+ const endMonth = startMonth + 2
+
+ const start = new Date(year, startMonth, 1)
+ const end = new Date(year, endMonth + 1, 0) // 鍙栧綋鏈堟渶鍚庝竴澶�
+
+ return {
+ start: this.formatDate(start),
+ end: this.formatDate(end)
+ }
+ },
+
+ // 鑾峰彇 涓婁竴瀛e害 寮�濮嬨�佺粨鏉熸棩鏈�
+ getLastQuarter() {
+ const now = new Date()
+ const year = now.getFullYear()
+ const month = now.getMonth()
+
+ let quarter = Math.floor(month / 3)
+ let lastQuarter = quarter - 1
+ let lastYear = year
+
+ // 濡傛灉鏄涓�瀛e害锛屼笂瀛e害灏辨槸鍘诲勾绗洓瀛e害
+ if (lastQuarter < 0) {
+ lastQuarter = 3
+ lastYear = year - 1
+ }
+
+ const startMonth = lastQuarter * 3
+ const endMonth = startMonth + 2
+
+ const start = new Date(lastYear, startMonth, 1)
+ const end = new Date(lastYear, endMonth + 1, 0)
+
+ return {
+ start: this.formatDate(start),
+ end: this.formatDate(end)
+ }
+ },
+
+ // 鏃ユ湡鏍煎紡鍖栵細yyyy-MM-dd
+ formatDate(date) {
+ const y = date.getFullYear()
+ const m = (date.getMonth() + 1).toString().padStart(2, '0')
+ const d = date.getDate().toString().padStart(2, '0')
+ return `${y}-${m}-${d}`
+ },
+
+
// 鏃ュ巻鏃堕棿鐐瑰嚮
calendarClick() {
this.$refs.calendar.open();
--
Gitblit v1.9.3