소스 검색

分摊无项目人员成本,增加自定义审批流是否开启判断

seyason 3 년 전
부모
커밋
3ccb6ad594

+ 15 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/ExpenseItemVO.java

@@ -0,0 +1,15 @@
+package com.management.platform.entity.vo;
+
+import com.management.platform.entity.ExpenseItem;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class ExpenseItemVO extends ExpenseItem {
+    public String username;
+    public String departmentName;
+
+}

+ 6 - 2
fhKeeper/formulahousekeeper/timesheet/src/main.js

@@ -135,10 +135,14 @@ router.beforeEach((to, from, next) => {
                     if (user.timeType.syncCorpwxTime == 1) {
                         getRoutes = getRoutes.filter(r=>{return r.name != '项目报告审核'});
                     }
-                    
-                    
+                    //检查是否开启了自定义审批流
+                    if (user.timeType.reportWorkflow == 0) {
+                        getRoutes = getRoutes.filter(r=>{return r.name != '审批流设置'});
+                        console.log(getRoutes);
+                    }
                     global.antRouter = fixedRouter.concat(getRoutes);
                     router.addRoutes(fixedRouter.concat(getRoutes));
+                    console.log(router);
                     router.options.routes = fixedRouter.concat(getRoutes);
                     router.push({ path: to.path })
                 }

+ 2 - 12
fhKeeper/formulahousekeeper/timesheet/src/routes.js

@@ -260,16 +260,6 @@ export const allRouters = [//组织架构
             { path: '/customer', component: customer, name: '客户管理' }
         ]
     },
-    // {
-    //     path: '/',
-    //     component: Home,
-    //     name: '研究中心',
-    //     iconCls: 'iconfont firerock-iconkehuguanli',
-    //     leaf: true,
-    //     children: [
-    //         { path: '/research', component: research, name: '研究中心' }
-    //     ]
-    // },
     {
         path: '/',
         component: Home,
@@ -305,11 +295,11 @@ export const allRouters = [//组织架构
         
         path: '/',
         component: Home,
-        name: '',
+        name: '审批流设置',
         iconCls: 'iconfont firerock-iconliucheng',
         leaf: true,//只有一个节点
         children: [
-            { path: '/workflow', component: workflow, name: '审批流设置' },
+            { path: '/workflow', component: workflow, name: '审批流设置' },
         ]
     },
     //设置时间类型

+ 63 - 25
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -152,6 +152,11 @@
                         {{(scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing).toFixed(2)}}
                     </template>
                 </el-table-column>
+                <el-table-column  label="明细"  width="100" align="right">
+                  <template slot-scope="scope">
+                        <el-link type="primary" :underline="false" @click="showDetail(scope.row)">明细</el-link>
+                    </template>
+                </el-table-column>
             </el-table>
             <!--项目收支平衡表 -->
             <el-table v-if="ins == 3"  :key="ins" border :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
@@ -364,6 +369,39 @@
                 <el-button @click.native="addFormVisible = false">关闭</el-button>
             </div>
         </el-dialog>
+
+        <el-dialog title="项目费用明细" show-summary v-if="detailVisible" :visible.sync="detailVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
+        <el-table  :key="ins" border :data="detailList" highlight-current-row v-loading="detailListLoading" :height="500" style="width: 100%;">
+                <el-table-column  prop="username" label="员工姓名"  width="120"></el-table-column>
+                <el-table-column  prop="departmentName" label="所在部门" ></el-table-column>
+                <el-table-column  prop="feeType" label="所在部门" ></el-table-column>
+                <el-table-column prop="feeMan" label="人工成本"  width="100"  align="right">
+                  <template slot-scope="scope">
+                        {{scope.row.feeMan==null?0:scope.row.feeMan.toFixed(2)}}
+                    </template>
+                </el-table-column>
+                <el-table-column prop="feeNormal" label="一般费用"  width="100" align="right">
+                  <template slot-scope="scope">
+                        {{scope.row.feeNormal==null?0:scope.row.feeNormal.toFixed(2)}}
+                    </template>
+                </el-table-column>
+                <el-table-column prop="feeTravel" label="差旅费用"  width="100" align="right">
+                  <template slot-scope="scope">
+                        {{scope.row.feeTravel==null?0:scope.row.feeTravel.toFixed(2)}}
+                    </template>
+                </el-table-column>
+                <el-table-column prop="feeOutsourcing" label="外包费用"  width="100" align="right">
+                  <template slot-scope="scope">
+                        {{scope.row.feeOutsourcing==null?0:scope.row.feeOutsourcing.toFixed(2)}}
+                    </template>
+                </el-table-column>
+                <el-table-column  label="总费用"  width="100" align="right">
+                  <template slot-scope="scope">
+                        {{(scope.row.feeMan+scope.row.feeNormal+scope.row.feeTravel+scope.row.feeOutsourcing).toFixed(2)}}
+                    </template>
+                </el-table-column>
+            </el-table>
+        </el-dialog>
   </section>
 </template>
 
@@ -374,6 +412,9 @@ export default {
   props: {},
   data() {
     return {
+      detailListLoading: false,
+      detailList:[],
+      detailVisible: false,
       stages:[],
       addFormVisible:false,
       title:'',
@@ -453,36 +494,33 @@ export default {
       }
   },
   methods: {
+    showDetail(row) {
+      this.detailListLoading = true;
+      this.detailVisible = true;
+      this.http.post('/expense-item/list', {projectId: row.id},
+            res => {
+              this.detailListLoading = false;
+                if (res.code == "ok") {
+                    this.detailList = res.data;
+                } else {
+                    this.$message({
+                    message: res.msg,
+                    type: "error"
+                    });
+                }
+            },
+            error => {
+                this.$message({
+                    message: error,
+                    type: "error"
+                });
+            });
+    },
     expandRow(row, index) {
       this.title = '客户:'+row.customerName;
         this.childrenList = row.children;
         this.addFormVisible = true;
       },
-    // load(tree, treeNode, resolve) {
-    //     // setTimeout(() => {
-    //     //   resolve()
-    //     // }, 1000)
-    //     [
-    //         {
-    //           projectIds: 31,
-    //           projectNames: '2016-05-01',
-    //           contractAmount: 0,
-    //           feeMan:0,
-    //           feeNormal:0,
-    //           feeTravel:0,
-    //           feeOutsourcing:0,
-    //         },
-    //         {
-    //           projectIds: 32,
-    //           projectNames: '2016-05-01',
-    //           contractAmount: 0,
-    //           feeMan:0,
-    //           feeNormal:0,
-    //           feeTravel:0,
-    //           feeOutsourcing:0,
-    //         },
-    //       ]
-    //   },
 
             //分页
             handleCurrentChange(val) {

+ 10 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -47,7 +47,8 @@
         
         <el-form :inline="true" >
             <el-form-item >
-                <el-link type="primary" :underline="false" @click="assignToProject" style="margin-left:5px;">查看项目成本分配</el-link>
+                <el-checkbox style="margin-left:10px;" v-model="assignNoProUser" @click="assignToProject">均摊无项目人员成本</el-checkbox>
+                <el-button type="primary" :underline="false" size="small" @click="assignToProject" style="margin-left:10px;">查看项目成本分配</el-button>
             </el-form-item>
 
             <el-form-item style="float:right;">
@@ -185,6 +186,7 @@
     export default {
         data() {
             return {
+                assignNoProUser: false,
                 customFieldList:{field1:null, field2: null, field3: null},
                 itemDialog: false,
                 customCols:[],
@@ -270,7 +272,7 @@
             },
             assignToProject(){
                 var _this = this;
-                this.http.post('/finance/getTimeCost', {yearMonth: this.date},
+                this.http.post('/finance/getTimeCost', {yearMonth: this.date, assignNoProUser: this.assignNoProUser},
                 res => {
                     if (res.code == "ok") {
                         var xList = [], yList = [], list = res.data.costList, 
@@ -298,8 +300,11 @@
                         _this.myChart = myChart;
                         var option = {
                             title: {
-                                text: '项目成本总计 ' + totalMoneyCost + '元'
-                                    +(this.hasNoProjectUsers?",无项目人员成本总计 " + nopCost+"元, 共: "+(totalMoneyCost+nopCost)+"元":""),
+                                text: this.assignNoProUser?'成本总计 ' + totalMoneyCost + '元'
+                                    +(this.hasNoProjectUsers?",含无项目人员成本总计 " + nopCost+"元 ":"")
+                                    :'项目成本总计 ' + totalMoneyCost + '元'
+                                    +(this.hasNoProjectUsers?",无项目人员成本总计 " + nopCost+"元, 共: "+(totalMoneyCost+nopCost)+"元":"")
+                                    ,
                                 left:'left',
                             },
                             // 工具箱
@@ -374,7 +379,7 @@
             exportData() {
                 this.listLoading = true;
                 this.http.post('/finance/exportData', {
-                    date: this.date
+                    date: this.date, assignNoProUser: this.assignNoProUser
                 },
                 res => {
                     this.listLoading = false;