Sfoglia il codice sorgente

提交相关代码

Lijy 1 mese fa
parent
commit
9fbb31c8ad

+ 83 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/project/financeComponents/salaryDetails.vue

@@ -9,10 +9,16 @@
                 <el-form-item :label="this.$t('Selectmonth')">
                     <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM"
                         value-format="yyyy-MM" @change="loadMonthData" :clearable="false" type="month"
-                        :placeholder="$t('Selectmonth')" style="margin-right: 20px"></el-date-picker>
+                        :placeholder="$t('Selectmonth')" style="margin-right: 20px;width: 120px"></el-date-picker>
                     <el-link type="primary" :underline="false" @click="audits()"
                         v-if="user.timeType.financeAudit == '1'">{{ revaelse }}</el-link>
                 </el-form-item>
+                <el-form-item label="部门">
+                    <el-cascader v-model="departmentId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width: 160px" @change="loadMonthData"
+                      :options="departmentArray" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false"  clearable v-if="user.userNameNeedTranslate != 1" size="small"></el-cascader>
+
+                      <vueCascader :size="'small'" :widthStr="'160'" :clearable="true && user.userNameNeedTranslate != 1" :subject="departmentArray" :subjectId="departmentId" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" ></vueCascader>
+                </el-form-item>
                 <!-- <el-radio-group v-model="radio" @change="switchList" style="margin-left:160px;margin-top:5px;"> -->
                 <el-radio-group size="small" v-model="radio" @change="switchList"
                     style="margin-left:150px;margin-top:5px;">
@@ -795,10 +801,13 @@ import { error } from 'dingtalk-jsapi';
 import util from "../../../common/js/util";
 // 自定义select组件
 import selectCat from "@/components/select.vue"
+ // 引入自定义级联组件
+import vueCascader from "@/components/cascader.vue"
 import dayjs from 'dayjs';
 export default {
     components: {
-        selectCat
+        selectCat,
+        vueCascader
     },
     props: {
         typeOfFunds: {
@@ -895,9 +904,62 @@ export default {
             notParticipatingInSharedProjectsLoading: false,
             notParticipatingInSharedAllProject: false,
             notParticipatingInSharedProjectDisabled: false,
+            departmentId: '',
+            departmentArray: []
         };
     },
     methods: {
+        // 获取部门列表
+        getDepartment() {
+            this.http.post(
+                this.port.manage.depList,
+                {},
+                (res) => {
+                if (res.code == "ok") {
+                    var list = res.data,
+                        list1 = JSON.parse(JSON.stringify(res.data));
+                        list.splice(0, 0, {
+                        id: -1,
+                        label: this.$t('lable.allStaff'),
+                    });
+                    list.push({
+                        id: 0,
+                        label: this.$t('lable.unassigned'),
+                    });
+                    this.departmentArray = this.changeArr(list1);
+                } else {
+                    this.$message({
+                        message: res.msg,
+                        type: "error",
+                    });
+                }
+                },
+                (error) => {
+                this.$message({
+                    message: error,
+                    type: "error",
+                });
+                }
+            );
+        },
+        // 修改数组
+        changeArr(arr) {
+        for (var i = 0; i < arr.length; i++) {
+            if (arr[i].id != -1 && arr[i].id != 0) {
+            if (arr[i].children != null && arr[i].children.length > 0) {
+                arr[i].children = this.changeArr(arr[i].children);
+            }
+            arr[i].id && (arr[i].value = arr[i].id);
+            delete arr[i].id;
+            }
+        }
+        for (var i in arr) {
+            if (arr[i].id == -1 || arr[i].id == 0) {
+            arr.splice(i, 1);
+            }
+        }
+        return arr;
+        },
         switchMenu() {
             this.$emit('switchMenu')
         },
@@ -1098,7 +1160,8 @@ export default {
         exportFinance() {
             this.isUploading = true;
             this.http.post('/finance/exportFinance', {
-                date: this.exportMonth
+                date: this.exportMonth,
+                deptId: this.departmentId[this.departmentId.length - 1]
             }, res => {
                 this.isUploading = false;
                 if (res.code == 'ok') {
@@ -1583,7 +1646,11 @@ export default {
         // },
         assignToProject() {
             var _this = this;
-            this.http.post('/finance/getTimeCost', { yearMonth: this.date, assignNoProUser: this.assignNoProUser },
+            this.http.post('/finance/getTimeCost', { 
+                yearMonth: this.date, 
+                assignNoProUser: this.assignNoProUser,
+                deptId: this.departmentId[this.departmentId.length - 1]
+            },
                 res => {
                     if (res.code == "ok") {
 
@@ -1717,7 +1784,8 @@ export default {
                 date: this.date,
                 assignNoProUser: this.assignNoProUser,
                 groupByCategory: this.groupByCategory,
-                onlyTotal: this.personnelAllocation ? 1 : 0
+                onlyTotal: this.personnelAllocation ? 1 : 0,
+                deptId: this.departmentId[this.departmentId.length - 1]
             },
                 res => {
                     this.exportDataProcessing = false;
@@ -1781,9 +1849,14 @@ export default {
             this.getList();
             this.assignToProject();
             this.getMonths()
-
             this.getAllocateSelectedItems()
         },
+        vueCasader(obj) {
+            if(obj.distinction == '1') {
+                this.departmentId = [obj.id]
+                this.loadMonthData()
+            }
+        },
         // 批量导入人员薪资
         importFinance(item) {
             //首先判断文件类型
@@ -1879,7 +1952,8 @@ export default {
             this.listLoading = true;
             this.http.post('/finance/getByMonth', {
                 companyId: this.user.companyId,
-                yearMonth: this.date
+                yearMonth: this.date,
+                deptId: this.departmentId[this.departmentId.length - 1]
             },
                 res => {
                     this.listLoading = false;
@@ -2156,6 +2230,8 @@ export default {
         this.scrollFunction()
         this.getAllProjectList()
         this.getAllocateSelectedItems()
+
+        this.getDepartment()
     },
     updated() {
         this.$nextTick(() => {

+ 101 - 30
fhKeeper/formulahousekeeper/timesheet_mld/src/views/project/project_gantt.vue

@@ -113,12 +113,12 @@
           <el-button size="small" @click="weekSwitching('next')">下周</el-button>
         </div>
 
-        <div class="eachLayout">
+        <!-- <div class="eachLayout">
           <div class="eachLayout-colorBlock" style="background: #ffa500">待审核</div>
           <div class="eachLayout-colorBlock" style="background: #32cd32">已通过</div>
-          <div class="eachLayout-colorBlock" style="background: #ff0000">已驳回/漏填</div>
+          <div class="eachLayout-colorBlock" style="background: #ff0000">已驳回</div>
           <div class="eachLayout-colorBlock" style="background: #e0e0e0">未提交</div>
-        </div>
+        </div> -->
       </template>
 
       <!-- 任务类型 -->
@@ -192,18 +192,33 @@
       </template>
     </div>
 
-    <div :style="`height: ${radio1 == $t('an-xiang-mu-cha-kan') ? '40' : '0'}px`"></div>
-
-    <gantt v-if="isDataLoaded && user.userNameNeedTranslate != 1" ref="ganttTable1" class="left-container" :tasks="tasks" 
-    :stafforpro="radio1"
-    :valueDate="valueDate"
-    :key="updatakey1" 
-    @closeBounced="closeBounced"
-    :style="`height: ${radio1 == $t('an-xiang-mu-cha-kan') ? '84' : '88'}vh`"
-    ></gantt>
-    <vueGantt v-if="isDataLoaded && user.userNameNeedTranslate == 1" ref="ganttTable1" :stafforpro="radio1"
-    :valueDate="valueDate"
-    :key="updatakey1" :tasks="tasks"></vueGantt>
+    <div class="ganttChartLayout" v-if="isDataLoaded && user.userNameNeedTranslate != 1">
+      <div class="ganttChartStatusLayout">
+        <div class="ganttChartStatusLayout-title">审核状态</div>
+        <div class="ganttChartLayout-sts">
+          <div class="eachLayout-colorBlock" style="background: #ffa500">待审核</div>
+          <div class="eachLayout-colorBlock" style="background: #32cd32">已通过</div>
+          <div class="eachLayout-colorBlock" style="background: #ff0000">已驳回</div>
+          <div class="eachLayout-colorBlock" style="background: #e0e0e0">未提交</div>
+        </div>
+        <div class="ganttChartStatusLayout-title">计划状态</div>
+        <div class="ganttChartPlanStatus">
+          <template v-if="typeList && typeList.length">
+            <div
+              class="planStatusItems"
+              v-for="items in typeList"
+              :key="items.id"
+              :style="getPlanStatusStyle(items)"
+            >
+              {{ items.name || [] }}
+            </div>
+          </template>
+        </div>
+      </div>
+      <gantt ref="ganttTable1" class="left-container" :tasks="tasks" :stafforpro="radio1":valueDate="valueDate":key="updatakey1" @closeBounced="closeBounced":style="`height: 88vh`"
+      ></gantt>
+    </div>
+    
 
   <div class="demand-container" v-if="!isDataLoaded">
     <el-table height="84vh" :loading="demandListLoading" :data="demandList" border>
@@ -374,6 +389,14 @@ export default {
     localStorage.removeItem('ganttChartTaskId')
   },
   methods: {
+    getPlanStatusStyle(items) {
+      const color = items.color || '';
+      return {
+        color: color ? '#fff' : '',
+        background: color ? color : '',
+        borderColor: color ? color : ''
+      };
+    },
     // 获取部门列表
     getDepartment() {
         this.http.post( this.port.manage.depList, {},
@@ -873,7 +896,26 @@ export default {
     display: flex;
     align-items: center;
   }
+  .ganttChartLayout {
+    width: 100%;
+    height: 88vh;
+    display: flex;
+    justify-content: space-between;
+  }
+  .ganttChartStatusLayout {
+    width: 200px;
+    margin-right: 16px;
+    height: 100%;
+    border: 1px solid #cecece;
+    display: flex;
+    box-sizing: border-box;
+    padding: 10px 0;
+    display: flex;
+    flex-direction: column;
+  }
+
   .left-container {
+    flex: 1;
     overflow: hidden;
     position: relative;
   }
@@ -926,24 +968,53 @@ export default {
       display: flex;
       flex-wrap: wrap;
       line-height: 18px;
+    }
 
-      .eachLayout {
-        display: flex;
-        align-items: center;
-        margin-right: 30px;
-        margin-bottom: 12px;
-
-        .eachLayout-title {
-          margin-right: 10px;
-        }
+    .eachLayout {
+      display: flex;
+      align-items: center;
+      margin-right: 30px;
+      margin-bottom: 12px;
 
-        .eachLayout-colorBlock {
-          padding: 6px 14px;
-          color: #fff;
-          border-radius: 4px;
-          margin-right: 10px;
-        }
+      .eachLayout-title {
+        margin-right: 10px;
       }
     }
+
+    .ganttChartStatusLayout-title {
+      line-height: 16px;
+      font-size: 16px;
+      font-weight: bold;
+      padding: 0 10px;
+    }
+
+    .ganttChartLayout-sts {
+      line-height: 16px;
+      margin-bottom: 20px;
+    }
+
+    .eachLayout-colorBlock {
+      padding: 8px 14px;
+      color: #fff;
+      border-radius: 4px;
+      margin: 12px 10px 0 10px;
+    }
+
+    .ganttChartPlanStatus {
+      margin-top: 12px;
+      padding: 0 10px;
+      line-height: 16px;
+      overflow-y: auto;
+      flex: 1;
+    }
+
+    .planStatusItems {
+      padding: 8px 14px;
+      color: #fff;
+      border-radius: 4px;
+      margin-bottom: 12px;
+      border: 1px solid #cecece;
+      color: #999;
+    }
   }
 </style>