浏览代码

任务重启原因,报表加任务重启表

Lijy 2 年之前
父节点
当前提交
a4d09723a4

+ 24 - 0
fhKeeper/formulahousekeeper/timesheet/src/components/taskComponent.vue

@@ -430,6 +430,17 @@
                                         {{item.content.msg3}}
                                     </p>
                                     <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content}}</p>
+                                    <!-- 重启原因和责任人 -->
+                                    <span class="commentSpan" v-if="user.timeType.restartTaskNeedReason == 1 && item.reason != ''">重启原因:{{item.reason}}</span>
+                                    <span class="commentSpan" v-if="user.timeType.restartTaskNeedReason == 1 && item.taskPersonLiableList.length > 0">责任人: 
+                                        <span v-for="responsibility, responsibilityIndex in item.taskPersonLiableList" :key="responsibilityIndex">
+                                            <span v-if="user.userNameNeedTranslate == 1">
+                                                <ww-open-data type='userName' :openid='responsibility.userName'></ww-open-data>
+                                            </span>
+                                            <span v-if="user.userNameNeedTranslate != 1">{{responsibility.userName}}</span>
+                                            <span v-if="responsibilityIndex < item.taskPersonLiableList.length - 1">,</span>
+                                        </span>
+                                    </span>
                                 </em>
                             </div>
                             <span>{{item.createTime | relativeTime}}</span>
@@ -1895,6 +1906,19 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.carts .commentSpan {
+    float: none;
+    display: block;
+    margin-top: 0;
+    font-size: 14px;
+
+    span {
+        float: none;
+        display: inline-block;
+        margin-top: 0;
+        font-size: 14px;
+    }
+}
 .foooot {
     padding: 10px 20px 20px;
     text-align: right;

+ 80 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -38,6 +38,7 @@
                   <el-menu-item index="1-16" v-if="permissions.reportAllDepartmentParticipation || permissions.reportResponsibleDepartmentParticipation" @click="ssl(15)"><p>{{ $t('bumenchanyuqingkuang') }}</p></el-menu-item>
                   <el-menu-item index="1-17" v-if="permissions.reportPhaseHours || permissions.reportStageWorkingTime" @click="ssl(16)"><p>{{ $t('xiang-mu-ge-fen-zu-yu-jie-duan-gong-shi-biao') }}</p></el-menu-item>
                   <el-menu-item index="1-18" v-if="permissions.reportAllManhourCost || permissions.reportResponsibleManhourCost" @click="ssl(17)"><p>子项目工时成本表</p></el-menu-item>
+                  <el-menu-item index="1-19" v-if="user.timeType.restartTaskNeedReason == 1" @click="ssl(18)"><p>任务重启表</p></el-menu-item>
                   <!-- <el-menu-item index="1-12"><p @click="ssl(11)">人员工时统计表</p></el-menu-item> -->
                 </el-submenu>
               </el-menu>
@@ -71,7 +72,7 @@
           </el-select>
         </template>
         <!-- 时间段筛选 -->
-          <template v-if="ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 12 || ins == 5 || ins == 16 || ins == 17">
+          <template v-if="ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 12 || ins == 5 || ins == 16 || ins == 17 || ins == 18">
             <span>
               <span class="demonstration" style="color:#999;padding:0 10px">
                 {{ ins == 15 ? $t('xiang-mu-chuang-jian-shi-jian-duan') : $t('message.period') }}
@@ -118,11 +119,11 @@
           </el-select>
 
           <!-- 人员筛选 -->
-          <el-select v-if="(ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 14)  && user.userNameNeedTranslate != '1'" v-model="userId" :placeholder="$t('pleaseselectpersonnel')" @change="selcts()" clearable filterable size="small" style="margin-left:10px;width:150px">
+          <el-select v-if="(ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 14 || ins == 18)  && user.userNameNeedTranslate != '1'" v-model="userId" :placeholder="$t('pleaseselectpersonnel')" @change="selcts()" clearable filterable size="small" style="margin-left:10px;width:150px">
             <el-option v-for="(item, index) in selUserList" :key="index" :label="item.name" :value="item.id"></el-option>
           </el-select>
 
-          <selectCat :subject="selUserList" :subjectId="userId" :clearable="true" :size="mini" @selectCal="selectCal" v-if="(ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 14) && user.userNameNeedTranslate == '1'"></selectCat>
+          <selectCat :subject="selUserList" :subjectId="userId" :clearable="true" :size="mini" @selectCal="selectCal" v-if="(ins == 6 || ins == 8 || ins == 9 || ins == 10 || ins == 11 || ins == 14 || ins == 18) && user.userNameNeedTranslate == '1'"></selectCat>
           
 
           <!-- 待审核筛选切换 -->
@@ -810,6 +811,28 @@
                 <el-table-column align="center" prop="cost" label="子项目成本" min-width="150"></el-table-column>
             </el-table>
 
+            <!-- 任务重启表 -->
+            <el-table v-if="ins == 18"  key="18" border :data="taskRestartArr" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;">
+                <el-table-column align="center" prop="projectCode" label="项目编号" min-width="150"></el-table-column>
+                <el-table-column align="center" prop="projectName" label="项目名称" min-width="150"></el-table-column>
+                <el-table-column align="center" prop="taskName" label="任务名称" min-width="150"></el-table-column>
+                <el-table-column align="center" prop="restartReason" label="重启原因" min-width="150"></el-table-column>
+                <el-table-column align="center" prop="workingTime" label="责任人" min-width="150">
+                  <template slot-scope="scope">
+                    <div>
+                      <span v-for="item, index in scope.row.personLiableNames" :key="index">
+                        <span v-if="user.userNameNeedTranslate == '1'">
+                          <ww-open-data type='userName' :openid='item'></ww-open-data>
+                        </span>
+                        <span v-if="user.userNameNeedTranslate != '1'">{{item}}</span>
+                        <span v-if="index < scope.row.personLiableNames.length - 1">,</span>
+                      </span>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column align="center" prop="restartDate" label="重启时间" min-width="150"></el-table-column>
+            </el-table>
+
         <!--工具条-->
         <el-col :span="24" class="toolbar" v-if="ins != 6">
           <el-pagination
@@ -1077,13 +1100,13 @@ export default {
       this.$t('pojectbalancesheetincomestatement'),this.$t('customerprojectprofitstatement'),this.$t('projectphasetimesheet'),
       this.$t('statisticsofovertimework'),this.$t('timecostearlywarningtable'),this.$t('personneltimeallocationtable'),
       this.$t('statisticsofstafffillingintimerate'),this.$t('dailyreporttobereviewedstatistics'),this.$t('statisticsofpersonnelhours'),this.$t('taskgrouptimesheet'),this.$t('projectcostbaselinetable'),
-      this.$t('ren-yuan-yue-du-gong-shi-biao'), this.$t('bumenchanyuqingkuang'), this.$t('ge-fen-zu-yu-jie-duan-gong-shi-biao'), '子项目工时成本表'],
+      this.$t('ren-yuan-yue-du-gong-shi-biao'), this.$t('bumenchanyuqingkuang'), this.$t('ge-fen-zu-yu-jie-duan-gong-shi-biao'), '子项目工时成本表', '任务重启表'],
 
       shuzArr: [this.$t('projectreport'),this.$t('projectTaskReport'),this.$t('projectcoststatement'),
       this.$t('projectbalancesheet'),this.$t('customerprojectincomestatement'),this.$t('projectphasetimesheet'),
       this.$t('statisticsofovertimework'),this.$t('timecostearlywarningtable'),this.$t('personneltimeallocationtable'),
       this.$t('employeereporttimelinessrate'),this.$t('dailyreporttobereviewedstatistics'),this.$t('statisticsofpersonnelhours'),this.$t('taskgrouptimesheet'),this.$t('projectcostbaselinetable'),
-      this.$t('ren-yuan-yue-du-gong-shi-biao'), this.$t('bumenchanyuqingkuang'), this.$t('ge-fen-zu-yu-jie-duan-gong-shi-biao'), '子项目工时成本表'],
+      this.$t('ren-yuan-yue-du-gong-shi-biao'), this.$t('bumenchanyuqingkuang'), this.$t('ge-fen-zu-yu-jie-duan-gong-shi-biao'), '子项目工时成本表', '任务重启表'],
 
       ins: 10000,
       user: JSON.parse(sessionStorage.user),
@@ -1147,7 +1170,9 @@ export default {
       groupingItemsArr: [],
       groupingItemsArrTitle: [],
 
-      subprojectArr: []
+      subprojectArr: [],
+
+      taskRestartArr: [], // 任务重启表数据
     };
   },
   computed: {},
@@ -1237,6 +1262,7 @@ export default {
       if(this.permissions.reportAllDepartmentParticipation || this.permissions.reportResponsibleDepartmentParticipation) {this.ssl(15);this.defaultActive = '1-16';return}
       if(this.permissions.reportPhaseHours || this.permissions.reportStageWorkingTime) {this.ssl(16);this.defaultActive = '1-17';return}
       if(this.permissions.reportAllManhourCost || this.permissions.reportResponsibleManhourCost) {this.ssl(17);this.defaultActive = '1-18';return}
+      if(this.user.timeType.restartTaskNeedReason == 1) {this.ssl(18);this.defaultActive = '1-19';return}
       {this.allWrong = false}
     },
     rowspan(spanArr,position,spanName){
@@ -1480,8 +1506,10 @@ export default {
                   this.groupingItems()
                 } else if(this.ins == 17) {
                   this.getAubprojectArr()
+                } else if(this.ins == 18) {
+                  this.taskRestart()
                 }
-                if(this.ins != 16 && this.ins != 17) {
+                if(this.ins != 16 && this.ins != 17 && this.ins != 18) {
                   this.getUserList()
                 }
             },
@@ -1601,6 +1629,13 @@ export default {
           url += "/exportSubProjectTimeCost"
           sl.startDate = this.rangeDatas[0]
           sl.endDate = this.rangeDatas[1]
+        } else if(this.ins == 18) {
+          fName = '任务重启表' + '.xlsx'
+          url = "/task-restart/exportTaskRestartList"
+          sl.startDate = this.rangeDatas[0]
+          sl.endDate = this.rangeDatas[1]
+          sl.projectId = this.proJuctId
+          sl.personLiableId = this.userId
         }
           this.http.post(url, sl,
             res => {
@@ -2497,6 +2532,44 @@ export default {
       if(this.ins == 17) {
         this.getAubprojectArr()
       }
+      if(this.ins == 18) {
+        this.taskRestart()
+      }
+    },
+    // 任务重启表
+    taskRestart() {
+      this.listLoading = true
+      this.http.post('/task-restart/getTaskRestartList', {
+         startDate: this.rangeDatas[0],
+         endDate: this.rangeDatas[1],
+         projectId: this.proJuctId,
+         personLiableId: this.userId,
+         pageIndex: this.page,
+         pageSize: this.size,
+      },
+        res => {
+            this.listLoading = false
+            if (res.code == "ok") {
+                let arr = res.data.record
+                for(let i in arr) {
+                  arr[i].personLiableNames = arr[i].personLiableNames.split(',')
+                }
+                this.taskRestartArr = res.data.record
+                this.total = res.data.total
+            } else {
+                this.listLoading = false
+                this.$message({
+                  message: res.msg,
+                  type: "error"
+                });
+            }
+        },
+        error => {
+            this.$message({
+                message: error,
+                type: "error"
+            });
+        });
     },
     // 日期
     getCurrentRangeTime() {

+ 67 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -162,6 +162,31 @@
                     </el-table-column>
                 </el-table>
 
+                <!-- 重启时输入原因 -->
+                <el-dialog title="重启任务" :visible.sync="causeRejectionDialog" width="600px" :before-close="handleClose">
+                    <div>
+                        <el-form ref="causeRejectionForm" :model="causeRejectionForm" label-width="80px">
+                            <el-form-item label="重启原因">
+                                <el-input type="textarea" v-model.trim="causeRejectionForm.cause"></el-input>
+                            </el-form-item>
+                            <el-form-item label="责任人">
+                                <el-select v-if="user.userNameNeedTranslate != '1'" multiple collapse-tags v-model="causeRejectionForm.responsible" size="small" filterable clearable placeholder="请选择责任人" @change="$forceUpdate()">
+                                    <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
+                                        <span style="float: left">{{ item.name }}</span>
+                                        <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px;margin-right: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
+                                    </el-option>
+                                </el-select>
+
+                                <selectCat :subject="users" :subjectId="causeRejectionForm.responsible" :multiSelect="true" :filterable="true"  @selectCal="selectCal" :size="'small'" :distinction="'5'" v-if="user.userNameNeedTranslate == '1'"></selectCat>
+                            </el-form-item>
+                        </el-form>
+                    </div>
+                    <span slot="footer" class="dialog-footer">
+                        <el-button @click="causeRejectionDialog = false">取 消</el-button>
+                        <el-button type="primary" @click="causeRejectionClick()">确 定</el-button>
+                    </span>
+                </el-dialog>
+
                 <!--工具条-->
                 <el-col :span="24" class="toolbar">
                     <el-pagination
@@ -827,6 +852,12 @@ import { error } from 'dingtalk-jsapi';
         },
         data() {
             return {
+                causeRejectionDialog: false,
+                causeRejectionForm: {
+                    cause: '',
+                    responsible: []
+                },
+
                 showOrNot: false,
                 typeField: null,
                 searchField: '0',
@@ -1410,11 +1441,29 @@ import { error } from 'dingtalk-jsapi';
             },
             // 完成
             completes(e, el) {
-                this.http.post('/task/finish', {
+                this.causeRejectionForm = {
                     id: e,
-                    taskStatus: el
-                },
+                    taskStatus: el,
+                    cause: '',
+                    responsible: ''
+                }
+                if(el == 1 && this.user.timeType.restartTaskNeedReason == 1) {
+                    this.causeRejectionDialog = true
+                } else {
+                    this.restart(this.causeRejectionForm)
+                }
+            },
+            // 重启 和 完成
+            restart(obj) {
+                let from = {
+                    id: obj.id,
+                    taskStatus: obj.taskStatus,
+                    personLiableIds: obj.userList,
+                    reason: obj.cause
+                }
+                this.http.post('/task/finish', from,
                 res => {
+                    this.causeRejectionDialog = false
                     if (res.code == "ok") {
                         this.$message({
                             message: this.$t('operationissuccessful'),
@@ -1429,13 +1478,20 @@ import { error } from 'dingtalk-jsapi';
                     }
                 },
                 error => {
+                    this.causeRejectionDialog = false
                     this.listLoading = false;
                     this.$message({
                         message: error,
                         type: "error"
                     });
-                }
-                )
+                })
+            },
+            // 重启任务点击事件
+            causeRejectionClick() {
+                this.causeRejectionForm.userList = this.causeRejectionForm.responsible.toString()
+                console.log(this.causeRejectionForm)
+                // return
+                this.restart(this.causeRejectionForm)
             },
             // 点击任务事件
             editTask(task) {
@@ -2037,6 +2093,12 @@ import { error } from 'dingtalk-jsapi';
             selectCal(obj) {
                 if(obj.distinction == '1') {
                     this.addForm.executorListFront[obj.index].executorId = obj.id
+                } else if(obj.distinction == '5') {
+                    let arr = []
+                    for(var i in obj.arrUserList) {
+                        arr.push(obj.arrUserList[i].id) 
+                    }
+                    this.causeRejectionForm.responsible = arr
                 }
             }
         },