ソースを参照

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

山水共长天一色 3 年 前
コミット
a19105acf3

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -1,6 +1,7 @@
 var path = require('path')
 
 //  var ip = '127.0.0.1'
+// var ip = '192.168.2.20'
 var ip = '192.168.2.25'
 // var ip = '47.100.37.243' 
 

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet/src/permissions.js

@@ -19,6 +19,7 @@ const StringUtil = {
         structureAdd: false, // 添加人员 // 
         structureExport: false, // 导出人员 // 
         structureImport: false, // 导入人员 // 
+        structureCertificate: false, // 管理专业证书 //
 
         // 工时报告
         reportsCompany: false, // 查看全公司工时 // 后台
@@ -119,6 +120,7 @@ const StringUtil = {
         arr[i] == '查看全部出差' ? obj.awayOfficeAll = true : ''
         arr[i] == '出差统计' ? obj.awayOfficeStatistical = true : ''
         arr[i] == '出差流程设置' ? obj.awayOfficeProcess = true : ''
+        arr[i] == '管理专业证书' ? obj.structureCertificate = true : ''
     }
 
     return obj

+ 324 - 45
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -269,6 +269,24 @@
                         </el-option>
                     </el-select>
                 </el-form-item>
+                <el-form-item label="岗位职级" prop="phone">
+                    <el-input v-model="insertForm.position" placeholder="请输入岗位职级别" clearable></el-input>
+                </el-form-item>
+
+                <div class="zhaunye"><p>专业证书</p><p><el-link type="primary" @click="addCertificateList()">添加更多证书</el-link><el-link v-if="permissions.structureCertificate" type="primary" @click="managementDiolog = true" style="margin-left: 20px">管理专业证书</el-link></p></div>
+                <div class="certificateList">
+                    <div class="moreList">
+                        <div class="moreLiList" v-for="(item,index) in insertForm.certJson" :key="index">
+                            <div style="margin-right: 10px;width: 160px;">
+                                <el-select v-model="item.certId" placeholder="请选择专业证书" size="mini" @change="changeManagement(index)">
+                                    <el-option v-for="item in managementTableData" :key="item.id" :label="item.name" :value="item.id"> </el-option>
+                                </el-select>
+                            </div>
+                            <div><span>证书日期</span><el-date-picker size="mini" v-model="item.certDate" type="date" value-format="yyyy-MM-dd" placeholder="选择证书日期" style="width: 180px"></el-date-picker></div>
+                            <div style="color: red;margin-left: 15px;cursor:pointer;" @click="deteFrames(index)"><i class="el-icon-delete"></i></div>
+                        </div>
+                    </div>
+                </div>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisible=false">取消</el-button>
@@ -387,6 +405,40 @@
                 <el-button type="primary" @click="confirmDeactive">确定</el-button>
             </span>
         </el-dialog>
+        <!-- 管理专业证书 -->
+        <el-dialog title="管理专业证书" :visible.sync="managementDiolog" width="500px" :before-close="handleClose">
+            <div>
+                <el-table :data="managementTableData" style="width: 100%" height="400">
+                    <el-table-column prop="name" label="名称" width="280"></el-table-column>
+                    <el-table-column label="操作" width="180">
+                        <template slot-scope="scope">
+                            <div>
+                                <el-button type="primary" size="small" @click="editorManagementForm(scope.row)">编辑</el-button>
+                                <el-button type="danger" size="small" @click="deteManagementForm(scope.row)">删除</el-button>
+                            </div>
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="managementDiolog = false">关 闭</el-button>
+                <el-button type="primary" @click="addManagementDiologs()">新 增</el-button>
+            </span>
+        </el-dialog>
+        <!-- 新增项目管理专业 -->
+        <el-dialog title="新增/编辑管理专业证书" :visible.sync="addManagementDiolog" width="500px" :before-close="handleClose">
+            <div>
+                <el-form :model="managementForm" :rules="managementFormRou" ref="managementForm" label-width="150px" class="demo-ruleForm">
+                    <el-form-item label="专业证书名称" prop="name">
+                        <el-input v-model="managementForm.name" placeholder="请输入专业证书名称"></el-input>
+                    </el-form-item>
+                </el-form>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="addManagementDiolog = false">取 消</el-button>
+                <el-button type="primary" @click="addManagementForm('managementForm')">提 交</el-button>
+            </span>
+        </el-dialog>
     </section>
 </template>
 
@@ -429,7 +481,6 @@
                 page: 1,
                 size: 20,
                 list: [],
-
                 data: [
                     {
                         id: -1,
@@ -462,7 +513,9 @@
                     cost: null,
                     departmentId: null,
                     salaryType:0,
-                    costApplyDate: '2021-04-09'
+                    costApplyDate: '2021-04-09',
+                    position: '',
+                    certJson: []
                 },
                 rules: {
                     name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
@@ -472,7 +525,9 @@
                     cost: [{ required: true, message: "请输入成本", trigger: "blur" }],
                     monthCost:[{ required: true, message: "请输入月成本", trigger: "blur" }]
                 },
-
+                managementFormRou: {
+                    name: [{ required: true, message: "请输入专业证书", trigger: "blur" }],
+                },
                 dialogVisible1: false,
 
                 departmentVisible: false,
@@ -525,7 +580,15 @@
                 acquireRoleList: [], // 角色列表
                 acquireRoleLists: [], // 没有超级管理员
                 roleId: '',
-                xiuRoleId: ''
+                xiuRoleId: '',
+                managementDiolog: false,
+                addManagementDiolog: false,
+                managementForm: {
+                    name: ''
+                },
+                managementTableData: [],
+                certificate: '',
+                addUserId: ''
             };
         },
         filters: {
@@ -1072,21 +1135,56 @@
                     for(var i in arr) {
                         array.push(parseInt(arr[i]))
                     }
-                    this.insertForm = {
-                        id: list.id,
-                        name: list.name,
-                        phone: list.phone,
-                        // role: list.role,
-                        roleId: list.roleId,
-                        monthCost:list.monthCost,
-                        cost: list.cost,
-                        departmentId: array.reverse(),
-                        salaryType: list.salaryType,
-                        costApplyDate: list.costApplyDate,
-                        
-                    };
+                    // console.log(list, '数据')
+                    // this.insertForm = {
+                    //     id: list.id,
+                    //     name: list.name,
+                    //     phone: list.phone,
+                    //     // role: list.role,
+                    //     roleId: list.roleId,
+                    //     monthCost:list.monthCost,
+                    //     cost: list.cost,
+                    //     departmentId: array.reverse(),
+                    //     salaryType: list.salaryType,
+                    //     costApplyDate: list.costApplyDate,
+                    //     position: list.position
+                    // };
+                    this.addUserId = list.id
+                    this.http.post('/user/getUserInfo', {
+                        userId: list.id
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.insertForm = {
+                                id: res.data.id,
+                                name: res.data.name,
+                                phone: res.data.phone,
+                                roleId: res.data.roleId,
+                                monthCost:res.data.monthCost,
+                                cost: res.data.cost,
+                                departmentId: array.reverse(),
+                                salaryType: res.data.salaryType,
+                                costApplyDate: res.data.costApplyDate,
+                                position: res.data.position,
+                                certJson: res.data.certList
+                            };
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
                     this.title = "编辑人员"
                 } else {
+                    this.addUserId = ''
                     this.insertForm = {
                         id: null,
                         name: null,
@@ -1098,6 +1196,8 @@
                         departmentId: null,
                         salaryType:0,
                         costApplyDate: util.formatDate.format(new Date(), 'yyyy-MM-dd'),
+                        position: '',
+                        certJson: [],
                     };
                     this.title = "新增人员"
                 }
@@ -1106,9 +1206,18 @@
 
             submitInsert() {
                 var form = {}
+                var ssR = this.upRepeat(this.insertForm.certJson)
                 this.$refs.form1.validate(valid => {
                     if (valid) {
                         this.submitLoading = true;
+                        if(ssR) {
+                            this.$message({
+                                message: '重复证书',
+                                type: 'warning'
+                            });
+                            this.submitLoading = false;
+                            return false
+                        }
                         form = {
                             name: this.insertForm.name,
                             phone: this.insertForm.phone,
@@ -1117,6 +1226,9 @@
                             monthCost: this.insertForm.monthCost,
                             cost: this.insertForm.cost,
                             salaryType: this.insertForm.salaryType,
+                            position: this.insertForm.position,
+                            certJson: JSON.stringify(this.insertForm.certJson)
+                            // certJson: this.insertForm.certJson
                         };
                         if (this.insertForm.id != null) {
                             form.id = this.insertForm.id;
@@ -1129,37 +1241,36 @@
                         }
                     }
                 });
-                console.log(form, '提交的数据')
-                // if(this.permissions.structurePersonnel && this.title == '编辑人员') {
-                //     form.cost = 0
-                //     form.monthCost = 0 
-                // }
+                // console.log(form, '提交的数据')
                 // return
-                this.http.post( this.port.manage.insert, form,
-                        res => {
-                            this.submitLoading = false;
-                            if (res.code == "ok") {
-                                this.$message({
-                                    message: this.insertForm.id != null ? "修改" : "创建" + "成功",
-                                    type: "success"
-                                });
-                                this.dialogVisible = false;
-                                this.getUser();
-                                this.getUsers()
-                            } else {
-                                this.$message({
-                                    message: res.msg,
-                                    type: "error"
-                                });
-                            }
-                        },
-                        error => {
-                            this.listLoading = false;
+                if(!ssR) {
+                    this.http.post( this.port.manage.insert, form,
+                    res => {
+                        this.submitLoading = false;
+                        if (res.code == "ok") {
                             this.$message({
-                                message: error,
+                                message: this.insertForm.id != null ? "修改" : "创建" + "成功",
+                                type: "success"
+                            });
+                            this.dialogVisible = false;
+                            this.getUser();
+                            this.getUsers()
+                        } else {
+                            this.$message({
+                                message: res.msg,
                                 type: "error"
                             });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
                         });
+                    });
+                }
+                
             },
 
             // 切换角色
@@ -1253,7 +1364,9 @@
                     cost: list1.cost,
                     departmentId: array1.reverse(),
                     salaryType: list1.salaryType,
-                    name: list1.name
+                    name: list1.name,
+                    position: list1.position,
+                    certJson: list1.certJson
                 };
                 this.dialogVisible1 = true;
             },
@@ -1269,7 +1382,9 @@
                             phone: this.insertForm.phone,
                             roleId: this.insertForm.roleId,
                             monthCost: this.insertForm.monthCost,
-                            cost: this.insertForm.cost
+                            cost: this.insertForm.cost,
+                            position: this.insertForm.position,
+                            certJson: this.insertForm.certJson
                         };
                         if (this.insertForm.departmentId != null) {
                             form.departmentId = this.insertForm.departmentId[this.insertForm.departmentId.length-1];
@@ -1646,6 +1761,138 @@
                         type: "error"
                     });
                 });
+            },
+            // 获取专业分类
+            getProfessional() {
+                this.http.post('/company-cert/list', {},
+                res => {
+                    if (res.code == "ok") {
+                        this.managementTableData = res.data
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            addManagementDiologs() {
+                this.managementForm = {name: ''}
+                this.addManagementDiolog = true
+            },
+            // 新增/编辑人员专业费雷
+            addManagementForm(formName) {
+                this.$refs[formName].validate((valid) => {
+                if (valid) {
+                    this.http.post('/company-cert/addOrMod', this.managementForm,
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: '操作成功',
+                                type: "success"
+                            });
+                            this.getProfessional()
+                            this.addManagementDiolog = false
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                } else {
+                    console.log('error submit!!');
+                    return false;
+                }
+                });
+            },
+            // 编辑
+            editorManagementForm(item) {
+                this.managementForm = item
+                this.addManagementDiolog = true
+            },
+            // 删除专业
+            deteManagementForm(item) {
+                this.$confirm('该操作可能造成已有数据丢失,确定要删除吗?', '删除专业证书', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    this.http.post('/company-cert/delete', {
+                        id: item.id
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: '操作成功',
+                                type: "success"
+                            });
+                            this.getProfessional()
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '已取消删除'
+                });          
+                });
+            },
+            // 点击添加更多帧数
+            addCertificateList() {
+                var obj = {}
+                obj.certId = ''
+                obj.certName = ''
+                obj.certDate = ''
+                obj.id = ''
+                obj.userId = this.addUserId
+                this.insertForm.certJson.push(obj)
+            },
+            // 选择专业帧数
+            changeManagement(is) {
+                var id = this.insertForm.certJson[is].certId
+                for(var i in this.managementTableData) {
+                    if(this.managementTableData[i].id == id) {
+                        this.insertForm.certJson[is].certName = this.managementTableData[i].name
+                    }
+                }
+            },
+            // 查重复
+            upRepeat(arr) {
+                var obj = {};
+                for(var i in arr) {
+                    if(obj[arr[i].certName]) {
+                        return true;
+                    }
+                    obj[arr[i].certName] = true;
+                }
+                return false;
+            },
+            // 删除帧数
+            deteFrames(i) {
+                this.insertForm.certJson.splice(i, 1)
             }
         },
 
@@ -1665,6 +1912,7 @@
             this.getUsers();
             this.acquireRole();
             this.isDingShow = this.$store.state.isDing;
+            this.getProfessional()
         }
     };
 </script>
@@ -1737,4 +1985,35 @@
     .el-tree-node__content {
         height:36px;
     }
+    .zhaunye {
+        display: flex;
+        justify-content: space-between;
+        padding: 0 5px 0 10px;
+    }
+    .certificateList {
+        width: 98%;
+        box-sizing: border-box;
+        margin: 0 10px 0 10px;
+        border: 1px solid rgb(194, 194, 194);
+        min-height: 200px;
+        max-height: 200px;
+        overflow: auto;
+        padding: 10px;
+    }
+    .moreAl {
+        display: flex;
+        width: 100%;
+        justify-content: center;
+    }
+    .moreLiList {
+        display: flex;
+        margin-bottom: 10px;
+    }
+    .moreLiList div {
+        line-height: 30px;
+    }
+    .moreLiList span {
+        display: inline-block;
+        margin-right: 15px;
+    } 
 </style>

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

@@ -5,7 +5,7 @@
             <el-card class="box-card daily" shadow="never">
                 <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
                 <!-- <div class="jjk" style="display:inline-block;position:fixed;top:70px;background:#fff;left:250px;"> -->
-                <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;">
+                <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 43px;">
                         <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
                          style="width:190px;"
                          @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
@@ -4573,7 +4573,7 @@
     .clearfix {
         overflow-x: auto;
         white-space: nowrap;
-        padding: 15px 0;
+        padding: 15px 0 10px 0;
         // overflow-y: hidden;
         .date_item {
             padding: 0 3px;