Przeglądaj źródła

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

cs 2 lat temu
rodzic
commit
b06d9cfe16

+ 7 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/settings/timetype.vue

@@ -226,9 +226,11 @@
         <p style="margin-left:10px;color:#666;">{{ $t('timesetting') }}</p>
         <el-row :gutter="20" style="padding-top:10px;width:100%;margin:0 auto;padding-left:10px;padding-right:10px;">
         <el-col :span="24" >
-            <div class="panel" style="height:120px;">
+            <div class="panel" style="height:180px;">
                 <el-form :inline="true" :model="timeType"  style="margin-top:10px;">
-                 
+                <el-form-item>
+                    <el-checkbox v-model="timeType.includeWeekends" label="批量/代填含周末" />
+                </el-form-item><br/>
                 <el-form-item :label="$t('filltime')" prop="fillMonths">
                     <el-select v-model="timeType.fillMonths" >
                         <el-option v-for="item in monthTimeList" :key="item.id" :label="item.name" :value="item.id">
@@ -481,6 +483,7 @@
                     type: 0,
                     lockWorktime: false,
                     fillAhead: false,
+                    includeWeekends: false,
                     maxReportTime: 8
                 },
                 customDegreeActive: false,
@@ -990,6 +993,7 @@
                         param.fillOvertime = param.fillOvertime ? 1 : 0
                         param.lockWorktime = param.lockWorktime ? 1 : 0
                         param.fillAhead = param.fillAhead ? 1 : 0
+                        param.includeWeekends = param.includeWeekends ? 1 : 0
                         param.mainProjectState = param.mainProjectState ? 1 : 0
                         if(param.lockWorktime){
                             param.fillOvertime = 0
@@ -1061,6 +1065,7 @@
                             this.timeType.customDegreeStatus = this.timeType.customDegreeStatus ? true : false
                             this.timeType.customDataStatus = this.timeType.customDataStatus ? true : false
                             this.timeType.fillAhead = this.timeType.fillAhead ? true : false
+                            this.timeType.includeWeekends = this.timeType.includeWeekends ? true : false
                             this.timeType.mainProjectState = this.timeType.mainProjectState ? true : false
                             this.timeType.customDataMaxStatus = this.timeType.customDataMaxStatus ? true : false 
                             this.timeType.customDataMaxValue = this.timeType.customDataMaxValue ? this.timeType.customDataMaxValue : 100

+ 3 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -6368,6 +6368,9 @@
     //     height: 70px;
     //     z-index: 1010;
     // }
+    .editReportDialog{
+        min-width: 800px;
+    }
     .touruxiangmu{
         max-width: 1000px;
     }

+ 13 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/components/Footer.vue

@@ -12,6 +12,12 @@
                 <p class="mt-5 text f12">填报统计</p>
             </router-link>
         </li>
+        <li class="item" v-if="cost">
+            <router-link to="/cost" class="flex2 aic f20 text" active-class="active">
+                <van-icon class="text" name="bar-chart-o" />
+                <p class="mt-5 text f12">成本统计</p>
+            </router-link>
+        </li>
         <li class="item">
             <router-link to="/my" class="flex2 aic f20 text" active-class="active">
                 <van-icon class="text" name="user-o"></van-icon>
@@ -27,7 +33,8 @@
             return {
                 user: JSON.parse(localStorage.userInfo),
                 reportsCompany: false,
-                reportsDept: false
+                reportsDept: false,
+                cost: false
             }
         },
         mounted() {
@@ -39,6 +46,11 @@
                     this.reportsDept = true
                 }
             }
+            for(let i in this.user.moduleList){
+                if(this.user.moduleList[i].name == '工时成本统计'){
+                    this.cost = true
+                }
+            }
         },
     };
 </script>

+ 7 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/router/index.js

@@ -217,6 +217,13 @@ const router = new Router({
             title: "填报统计"
         }
     },
+    {
+        path: "/cost",
+        component: () => import("@/views/cost/cost"),
+        meta: {
+            title: "成本"
+        }
+    },
     {
         path: "*",
         component: () => import("@/components/NotFound")

+ 156 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/cost/cost.vue

@@ -0,0 +1,156 @@
+<template>
+<div>
+    <div class="title222">
+        <van-sticky offset-top="-0.9rem">
+            <van-cell :title="'选择日期:' + costDateTitle" @click="costDateShow = true" class="costDateSel" />
+            <van-calendar v-model="costDateShow" type="range" :show-confirm="false" @confirm="dateConfirm" :min-date="minDate" :max-date="maxDate" />
+            <van-tabs v-model="active" @change="activeChange" background="#20a0ff" title-active-color="#fff" title-inactive-color="#3c3c45" style="height:1.17333rem;">
+                <van-tab title="项目"></van-tab>
+                <van-tab title="项目分类"></van-tab>
+            </van-tabs>
+        </van-sticky>
+    </div>
+    <div style="padding-top:2px;margin-bottom:1.33333rem">
+            <van-cell v-if="listLoading" style="padding-top:2px;background-color: transparent;">
+                <template #default>
+                    <van-loading color="#1989fa" size="24" text-size="12" style="text-align:center;">加载中...</van-loading>
+                </template>
+            </van-cell>
+            <van-cell v-if="timeCostList.length == 0" style="padding-top:2px;background-color: transparent;">
+                <template #default>
+                    <div style="text-align:center;color:#7d7e80;font-size:13px">暂无数据</div>
+                </template>
+            </van-cell>
+            <template v-else>
+                <span v-if="active == 0">
+                <van-cell v-for="item in timeCostList" :key="item.id" style="padding: 2px 4px;background-color: transparent;">
+                    <div style="padding: 0.26667rem 0.42667rem;background-color: #fff;">
+                        <van-row>
+                            <van-col span="6" style="text-align:center">项目名称:</van-col>
+                            <van-col span="18">{{item.project}}</van-col>
+                        </van-row>
+                        <van-row>
+                            <van-col span="6" style="text-align:center">项目编号:</van-col>
+                            <van-col span="18">{{item.projectCode}}</van-col>
+                        </van-row>
+                        <van-row style="color:#969799">
+                            <van-col span="4" style="text-align:center">工时:</van-col>
+                            <van-col span="6">{{item.cost}} h</van-col>
+                            <van-col span="4" style="text-align:center">成本:</van-col>
+                            <van-col span="10">¥ {{item.costMoney}}</van-col>
+                        </van-row>
+                    </div>
+                </van-cell>
+                </span>
+                <span v-if="active == 1">
+                <van-cell v-for="item in timeCostList" :key="item.category" style="padding: 2px 4px;background-color: transparent;">
+                    <div style="padding: 0.26667rem 0.42667rem;background-color: #fff;">
+                        <van-row>
+                            <van-col span="6" style="text-align:center">分类名称:</van-col>
+                            <van-col span="18">{{item.categoryName}}</van-col>
+                        </van-row>
+                        <van-row style="color:#969799">
+                            <van-col span="4" style="text-align:center">工时:</van-col>
+                            <van-col span="6">{{item.cost}} h</van-col>
+                            <van-col span="4" style="text-align:center">成本:</van-col>
+                            <van-col span="10">¥ {{item.costMoney}}</van-col>
+                        </van-row>
+                    </div>
+                </van-cell>
+                </span>
+            </template>
+    </div>
+    
+    <Footer page="index"></Footer>
+</div>
+</template>
+
+<script>
+import Footer from "@/components/Footer";
+export default {
+    components: {
+        Footer
+    },
+    data() {
+        return {
+            active: 0,
+            listLoading: false,
+            minDate: new Date(2020,0,1),
+            maxDate: new Date(2025,11,31),
+            costDateTitle: '',
+            costDate: [],
+            costDateShow: false,
+            timeCostList: []
+        }
+    },
+    mounted() {
+        let end = new Date()
+        let start = new Date(end.getFullYear(),end.getMonth(),1)
+        this.costDate = [this.formatDate(start),this.formatDate(end)]
+        this.costDateTitle = this.dateToTitle(this.costDate)
+        this.getTimeCost()
+    },
+    methods: {
+        formatDate(date) {
+            let mon = date.getMonth() + 1
+            return `${date.getFullYear()}-${mon<10?'0'+mon:mon}-${date.getDate()<10?'0'+date.getDate():date.getDate()}`;
+        },
+        dateToTitle(dateArr){
+            let start = dateArr[0].split('-')
+            let end = dateArr[1].split('-')
+            return `${start[0]}年${start[1]}月${start[2]}日\u3000至\u3000${end[0]}年${end[1]}月${end[2]}日`
+        },
+        activeChange(name,title){
+            this.timeCostList = []
+            this.getTimeCost()
+        },
+        dateConfirm(value,date){
+            this.costDate = [this.formatDate(value[0]),this.formatDate(value[1])]
+            this.costDateTitle = this.dateToTitle(this.costDate)
+            this.costDateShow = false
+            this.getTimeCost()
+        },
+        
+
+        getTimeCost(){
+            let url = this.active ? '/project/getTimeCostByCategory' : '/project/getTimeCost'
+            this.listLoading = true
+            this.$axios.post(url, {
+                startDate: this.costDate[0],
+                endDate: this.costDate[1]
+            }).then(res => {
+                if(res.code == "ok") {
+                    this.listLoading = false
+                    this.timeCostList = res.data.costList
+                } else {
+                    this.listLoading = false
+                    this.$toast.clear();
+                    this.$toast.fail('获取失败');
+                }
+            }).catch(err=> {this.listLoading = false;this.$toast.clear();console.log(err)});
+        }
+    },
+}
+</script>
+
+<style>
+.title222 {
+    background-color: #20a0ff;
+    overflow: hidden;
+}
+.costDateSel {
+    background-color: #20a0ff;
+    color: #fff;
+    font-size: 12px !important;
+    padding-top: 0.14rem;
+    padding-left: 0.43rem;
+    padding-bottom: 0.3rem;
+    height: 1.08rem;
+}
+.costDateSel::after{
+    display: none;
+}
+.title222 .van-tabs__line{
+    background-color: #f7f7f7;
+}
+</style>

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/count/count.vue

@@ -76,7 +76,7 @@
         </div>
     </van-sticky>
     </div>
-    <van-cell-group>
+    <van-cell-group style="margin-bottom:1.33333rem">
         <van-cell v-if="listLoading">
             <template #default>
                 <van-loading color="#1989fa" size="24" text-size="12" style="text-align:center;">加载中...</van-loading>
@@ -300,7 +300,7 @@ export default {
 
 <style>
 body{
-    background: #fff;
+    /* background: #fff; */
 }
 .monthSelectContent {
     padding: 16px 16px 16px;

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/edit.vue

@@ -151,7 +151,7 @@
         <div class="form_btn" style="position: fixed; bottom: 0px; width: 100%">
             <div style="padding-bottom: 10px">
                 <van-button square block type="info" @click="deleteProject()" style="width: 50%; float: left">删除</van-button>
-                <van-button square block type="info" @click="submitProject" style="width: 50%; float: left">保存</van-button>
+                <van-button square block type="danger" @click="submitProject" style="width: 50%; float: left">保存</van-button>
             </div>
         </div>
     </div>