小小儁爺
6 天以前 fb814a1ea0062a8ac3b1c60d0d22e20e3fa3ee11
1.app生产报工新增   本季度  上一季度的时间过滤
已修改4个文件
124 ■■■■■ 文件已修改
components/page-nav/page-nav.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mjgl/mjcx2.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/scgl/scbg.vue 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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">
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) 客户现场实际服务器ip
// Vue.prototype.$baseUrl = 'http://192.168.2.138:9090/api' //大岛项目(2.0) 客户现场实际服务器ip   验收
Vue.prototype.$baseUrl = 'http://192.168.0.32:8000/api' //上靖项目      客户现场实际服务器ip
Vue.prototype.$baseUrl = 'http://60.191.195.186:8989/api' //金风   客户现场实际服务器ip  外网
// Vue.prototype.$baseUrl = 'http://121.196.36.24:8051/api' //金风   公司云
// Vue.prototype.$baseUrl = 'http://192.168.0.32:8000/api' //上靖项目      客户现场实际服务器ip
// 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:圣沣,、B: 产品 ,C:上靖
Vue.prototype.$companyType = 'B' //企业类型(项目类型) A:巨力,B:圣沣,、B: 产品 ,C:上靖
// A:  http://121.196.36.24:8021/api  http://122.227.18.22:8000/api
// B:  http://121.196.36.24:8032/api  
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">
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="上一季度">
                        </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
                // 当前季度
                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)
                }
            },
            // 获取 上一季度 开始、结束日期
            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
                // 如果是第一季度,上季度就是去年第四季度
                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();