Jelajahi Sumber

审批流和、系统基础设置加周末节假日提醒

Lijy 2 tahun lalu
induk
melakukan
6a0c6dd250

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

@@ -4,7 +4,7 @@
 
         <el-col :span="24" class="toolbar" style="padding-bottom: 0px;position:sticky;top:0;z-index:1002">
             <el-form :inline="true">
-                <el-form-item :label="$t('navigation.basicSystemSettings')">
+                <el-form-item :label="$t('navigation.basicSystemSettings')"> 
                 </el-form-item>
                 <el-form-item  style="float:right">
                     <el-button  type="primary" @click="submitInsert" :loading="addLoading">{{ $t('save') }}</el-button>
@@ -207,7 +207,10 @@
                     </el-form-item>
                     <el-form-item :label="$t('remindertext')" prop="alertMsg" style="width: 50%;margin-left:10px;">
                             <el-input :placeholder="$t('peaseenterthe')" v-model="timeType.alertMsg" clearable class="apu" maxlength="20"></el-input>
+                            <div style="display: inline-block;margin: 0 10px 0 20px" v-if="timeType.alertTime">周末节假日提醒</div>
+                            <el-switch v-if="timeType.alertTime" v-model="timeType.alertNonWorkday" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
                     </el-form-item>
+
                     </el-form>
                     <div class="underpanel">
                         <div class="whiteList_head">
@@ -547,7 +550,8 @@
                     lockWorktime: false,
                     fillAhead: false,
                     includeWeekends: false,
-                    maxReportTime: 8
+                    maxReportTime: 8,
+                    alertNonWorkday: false
                 },
                 customDegreeActive: false,
                 needDeptAudit: false,
@@ -1112,6 +1116,8 @@
 
                         param.workContentState = param.workContentState ? 1 : 0
 
+                        param.alertNonWorkday = param.alertNonWorkday ? 1: 0
+
                         delete param.excludeTimeList
                         // console.log(param, '将要提交的值')
                         // return
@@ -1164,6 +1170,7 @@
                             this.timeType.customDataMaxStatus = this.timeType.customDataMaxStatus ? true : false 
                             this.timeType.customDataMaxValue = this.timeType.customDataMaxValue ? this.timeType.customDataMaxValue : 100
                             this.timeType.reportAutoApproveDays = this.timeType.reportAutoApproveDays ? this.timeType.reportAutoApproveDays : 1
+                            this.timeType.alertNonWorkday = this.timeType.alertNonWorkday ? true : false
                             this.timeChange();
 
                             this.maxReportTimeRange = [] // 填报时长上限

+ 67 - 24
fhKeeper/formulahousekeeper/timesheet/src/views/workflow/report.vue

@@ -251,26 +251,59 @@
             },
 
             addNode() {
-              this.dialogVisible = false;
-              if (this.curDeptId == null) return;
-              var node = ''
-              if(this.user.userNameNeedTranslate != 1) {
-                node = this.$refs.deptCascader.getCheckedNodes()[0];
-              } else {
-                node = this.addNodeObj
-              }
-              
-              console.log(node)
-              
-              if (this.isAdd) {
-                var node = {auditDeptId: node.value, auditDeptName: node.label, isDeptAudit:1};
-                this.dataArray.splice(this.index, 0, node);
-                console.log(this.dataArray);
-              } else {
-                //编辑
-                this.dataArray[this.index].auditDeptId = node.value;
-                this.dataArray[this.index].auditDeptName = node.label;
-              }
+                if (this.curDeptId == null) return;
+                this.dialogVisible = false;
+                var node = ''
+                if(this.user.userNameNeedTranslate != 1) {
+                    node = this.$refs.deptCascader.getCheckedNodes()[0];
+                } else {
+                    node = this.addNodeObj
+                }
+                
+                console.log(node)
+                
+                if (this.isAdd) {
+                    var node = {auditDeptId: node.value, auditDeptName: node.label, isDeptAudit:1};
+                    this.dataArray.splice(this.index, 0, node);
+                    console.log(this.dataArray);
+                } else {
+                    //编辑
+                    this.dataArray[this.index].auditDeptId = node.value;
+                    this.dataArray[this.index].auditDeptName = node.label;
+                }
+            },
+            // 判断部门
+            judgmentDepartment(id, item, index) {
+                this.http.post('/audit-workflow-time-setting/approveDeptAuditReport',{
+                    auditDeptId: id,
+                },
+                res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.$message({
+                            type: 'success',
+                            message: '操作成功!'
+                        });
+
+                        this.isAdd = false;
+                        this.index = index;
+                        this.curUserId = item.userId;
+                        this.dialogVisible = true;
+                        this.curDeptId = item.auditDeptId;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
             },
             editNodeDialog(index, item) {
                 //检查是否可编辑
@@ -284,10 +317,20 @@
                             this.dialogVisible = true;
                             this.curDeptId = item.auditDeptId;
                         } else {
-                            this.$message({
-                                message: res.msg,
-                                type: "error"
-                            });
+                            if(res.msg.indexOf('当前部门存在待审核报告') != '-1') {
+                                this.$confirm('当前部门存在待审核报告, 是否全部转为通过?', '提示', {
+                                    confirmButtonText: '确定',
+                                    cancelButtonText: '取消',
+                                    type: 'warning'
+                                }).then(() => {
+                                    this.judgmentDepartment(item.auditDeptId, item, index)
+                                }).catch(() => {});
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: "error"
+                                });
+                            }
                         }
                     },
                     error => {