Parcourir la source

Merge branch 'master' of http://139.196.39.194:9021/yuansh/GEKE_VIEW

LiGuang il y a 3 ans
Parent
commit
02106b37fa

+ 4 - 4
src/mixins/JeecgListMixin.js

@@ -20,7 +20,7 @@ export const JeecgListMixin = {
       /* 分页参数 */
       ipagination:{
         current: 1,
-        pageSize: 10,
+        pageSize: 20,
         pageSizeOptions: ['10', '20', '30'],
         showTotal: (total, range) => {
           return range[0] + "-" + range[1] + " 共" + total + "条"
@@ -54,7 +54,7 @@ export const JeecgListMixin = {
   },
   created() {
       if(!this.disableMixinCreated){
-        console.log(' -- mixin created -- ')
+        // console.log(' -- mixin created -- ')
         this.loadData();
         //初始化字典配置 在自己页面定义
         this.initDictConfig();
@@ -73,7 +73,7 @@ export const JeecgListMixin = {
   },
   methods:{
     loadData(arg) {
-      console.log("============="+arg);
+      // console.log("============="+arg);
       if(!this.url.list){
         this.$message.error("请设置url.list属性!")
         return
@@ -103,7 +103,7 @@ export const JeecgListMixin = {
       })
     },
     initDictConfig(){
-      console.log("--这是一个假的方法!")
+      // console.log("--这是一个假的方法!")
     },
     handleSuperQuery(params, matchType) {
       //高级查询方法

+ 1 - 1
src/views/system/modules/AttendanceRuleModal.vue

@@ -97,7 +97,7 @@
                   <a-menu-item key="0">
                     <a @click="shiftOks(0,d,record,index)">休息</a>
                   </a-menu-item>
-                  <a-menu-item v-if="isShow" v-for="(item,index) in shiftlist" :key="item.id">
+                  <a-menu-item v-for="(item,index) in shiftlist" :key="item.id">
                     <a @click="shiftOks(item,d,record,index)">{{item.name}} ({{item.startDate}} - {{item.endDate}})</a>
                   </a-menu-item>
 

+ 14 - 11
src/views/system/schedulingInformation/AttendanceInformation1.vue

@@ -3,7 +3,7 @@
     <a-col :md="4" :sm="12">
       <a-card :bordered="false">
         <div style="background: #fff;height: 100%; margin-top: 5px">
-          <a-input-search @search="onSearch" style="width:100%" placeholder="请输入部门名称"/>
+          <!-- <a-input-search @search="onSearch" style="width:100%" placeholder="请输入部门名称"/> -->
           <!-- 树-->
 
           <template v-if="userIdentity === '2' && departTree.length>0">
@@ -43,6 +43,7 @@
       </a-card>
     </a-col>
   </a-row>
+  <!-- <child @refreshList="loadData"></child> -->
 </template>
 <script>
   import DeptBaseInfo from '../modules/DeptBaseInfo'
@@ -107,17 +108,19 @@
         this.refresh();
       },
       clearSelectedDepartKeys() {
-        this.checkedKeys = [];
-        this.selectedKeys = [];
-        this.currentDeptId = '';
-        this.$refs.ViewClockUserInfo.currentDeptId='';
-        this.$refs.ViewClockUserInfo.currentDeptId='';
+        
+        this.refresh({viewDate:this.$refs.ViewClockUserInfo.newMonth});
+        // this.checkedKeys = [];
+        // this.selectedKeys = [];
+        // this.currentDeptId = '';
+        // this.$refs.ViewClockUserInfo.currentDeptId='';
+        // this.$refs.ViewClockUserInfo.currentDeptId='';
       },
-      loadTree() {
+      loadTree(viewDate) {
         var that = this
         that.treeData = []
         that.departTree = []
-        queryTreeList2().then((res) => {
+        queryTreeList2(viewDate).then((res) => {
           if (res.success) {
             for (let i = 0; i < res.result.length; i++) {
               let temp = res.result[i]
@@ -143,9 +146,9 @@
           */
         }
       },
-      refresh() {
+      refresh(viewDate) {
         this.loading = true
-        this.loadTree()
+        this.loadTree(viewDate)
       },
 
       onExpand(expandedKeys) {
@@ -177,7 +180,7 @@
       },
       onCheck(checkedKeys, e) {
         let record = e.node.dataRef;
-        console.log('111111onCheck', checkedKeys, e);
+        // console.log('111111onCheck', checkedKeys, e);
         this.checkedKeys = [];
         // if (e.checked === true) {
         this.currentDeptId = record.id;

+ 7 - 3
src/views/system/schedulingInformation/JiaoZhunModal.vue

@@ -18,7 +18,7 @@
           label="最早打卡时间">
           <!-- <a-date-picker  format='YYYY-MM-DD HH:mm:ss' v-model="startDate" /> -->
           <a-date-picker
-                :mode="mode1" v-model="startDate" :allowClear="false"
+                :mode="mode1" format='YYYY-MM-DD HH:mm:ss' v-model="startDate" :allowClear="false"
                 show-time
                 @openChange="handleOpenChange1"
                 @panelChange="handlePanelChange1"
@@ -31,7 +31,7 @@
           label="最迟打卡时间">
           <!-- <a-date-picker  format='YYYY-MM-DD HH:mm:ss' v-model="endDate" /> -->
           <a-date-picker
-                :mode="mode1" v-model="endDate" :allowClear="false"
+                :mode="mode1" format='YYYY-MM-DD HH:mm:ss' v-model="endDate" :allowClear="false"
                 show-time
                 @openChange="handleOpenChange1"
                 @panelChange="handlePanelChange1"
@@ -60,6 +60,7 @@
         endDate:"",
         viewDate:"",
         username:"",
+        setInfo:"",
         title:"操作",
         visible: false,
         type:"2",
@@ -113,6 +114,9 @@
       },
       handleOk () {
         const that = this;
+        this.startDate = moment(this.startDate).format('YYYY-MM-DD HH:mm:ss');
+        this.endDate = moment(this.endDate).format('YYYY-MM-DD HH:mm:ss');
+        
         // 触发表单验证
             // that.confirmLoading = true;
             // let httpurl = '';
@@ -126,7 +130,7 @@
             // }
             //时间格式化
             
-            jiaozhun({shiftTimeS:this.startDate,shiftTimeX:this.endDate,viewDate:this.viewDate,username:this.username}).then((res) => {
+            jiaozhun({shiftTimeS:this.startDate,shiftTimeX:this.endDate,viewDate:this.viewDate,username:this.username,setInfo:this.setInfo}).then((res) => {
               if (res == 'true') {
                 that.$message.success("已成功校准");
                 that.loadData();

+ 76 - 61
src/views/system/schedulingInformation/ViewClockInList.vue

@@ -5,7 +5,11 @@
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
-
+          <a-col :md="6" :sm="8">
+            <a-form-item label="工号">
+              <a-input placeholder="请输入工号" v-model="queryParam.workNo"></a-input>
+            </a-form-item>
+          </a-col>
           <a-col :md="6" :sm="8">
             <a-form-item label="人员">
               <a-input placeholder="请输入人员" v-model="queryParam.realname"></a-input>
@@ -16,46 +20,34 @@
               <a-input placeholder="请输入部门" v-model="queryParam.departNames"></a-input>
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="8">
-            <a-form-item label="工号">
-              <a-input placeholder="请输入工号" v-model="queryParam.workNo"></a-input>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="8">
+          
+         <!-- <a-col :md="6" :sm="8">
             <a-form-item label="班次">
               <a-input placeholder="请输入班次" v-model="queryParam.name"></a-input>
             </a-form-item>
-          </a-col>
-          <a-col :md="5" :sm="8">
-            <a-form-item label="操作类型" style="left: 10px">
-              <j-search-select-tag
-                      placeholder="请做出你的选择"
-                      v-model="selectValue"
-                      :dictOptions="dictOptions"> 
-                       <a-col :span="12">多选组合</a-col>
-                       </j-search-select-tag>
-             <!-- <j-dict-select-tag v-model="queryParam.name" placeholder="请选择用户名称" 
-                                 dictCode="geke_shift,name,name"/> -->
-            </a-form-item>
-          </a-col>
+          </a-col> -->
           
           <a-col :md="5" :sm="8">
-            <a-form-item label="异步加载" style="width: 300px">
-                  <j-search-select-tag
+            <a-form-item label="班次" style="width: 300px">
+                  <!-- <j-search-select-tag
                     placeholder="请做出你的选择"
                     v-model="asyncSelectValue"
                     dict="geke_shift,name,name"
                     :async="true">
-                  </j-search-select-tag>
+                  </j-search-select-tag> -->
+                  
+                  <a-select v-model="queryParam.name" placeholder="请选择班次">
+                    <a-select-option value="">请选择</a-select-option>
+                    <a-select-option value="a">休息</a-select-option>
+                    <a-select-option v-for="(item,index) in shiftlist" :value="item.name">{{item.name}} ({{item.startDate}}-{{item.endDate}})
+                    </a-select-option>
+                  </a-select>
+                  
                 </a-form-item>
           </a-col>
-          <!-- <a-col :md="6" :sm="8">
-            <a-form-item label="日期">
-              <a-date-picker valueFormat="YYYY-MM-DD"  @change="onChange" placeholder="请输入日期" v-model="queryParam.viewDate"></a-date-picker>
-            </a-form-item>
-          </a-col> -->
+          
           <a-col :md="6" :sm="10">
-            <a-form-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-form-item label="日期">
               <a-range-picker
                 style="width: 210px"
                 format="YYYY-MM-DD"
@@ -68,7 +60,7 @@
           <a-col :md="6" :sm="8">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <!-- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> -->
 
             </span>
           </a-col>
@@ -102,8 +94,15 @@
         @change="handleTableChange" :scroll="{ x: 3000 }">
 
         <span slot="latetimeState" slot-scope="text, record, index">
-          <a-tag color="pink" v-if="record.latetimeX > 0 || record.latetimeS > 0 ">异常</a-tag>
-          <a-tag color="#87d068" v-if="record.latetimeX <= 0 && record.latetimeS <= 0 ">正常</a-tag>
+          <!-- <a-tag color="pink" v-if="record.latetimeX > 0 || record.latetimeS > 0 ">异常</a-tag>
+          <a-tag color="#87d068" v-if="record.latetimeX <= 0 && record.latetimeS <= 0 ">正常</a-tag> -->
+          
+          <a-tag color="pink" v-if="record.latetimeS < 0 || record.latetimeX > 0
+          || record.shiftRealTimeS == '' || record.shiftRealTimeS == null
+          && (record.setInfo == '' || record.setInfo == null)">
+          异常
+          </a-tag>
+          <a-tag color="#87d068" v-else>正常</a-tag>
         </span>
         <span slot="realShiftTime" slot-scope="text, record, index">
           <!-- ruleType 上班类型 1.固定时间上下班,2.按班次上下班,3.自由上下班 -->
@@ -128,6 +127,12 @@
 </template>
 
 <script>
+  import {
+    httpAction,
+    getFileAccessHttpUrl,
+    getAction,
+    deleteAction
+  } from '@/api/manage'
   import {
     JeecgListMixin
   } from '@/mixins/JeecgListMixin'
@@ -148,17 +153,8 @@
     data() {
       return {
         moment,
+        shiftlist: null,
         description: '考勤日报',
-        dictOptions:[{
-          text:"选项一",
-          value:"1"
-        },{
-          text:"选项二",
-          value:"2"
-        },{
-          text:"选项三",
-          value:"3"
-        }],
         // 表头
         columns: [
           /* {
@@ -180,6 +176,10 @@
             title: '人员',
             align: 'center',
             dataIndex: 'realname', fixed: 'left', width: 100
+          },{
+            title: '部门',
+            align: 'center',
+            dataIndex: 'departNames', fixed: 'left', width: 100
           },
           // {
           //   title: '工号',
@@ -194,28 +194,32 @@
               customRender: 'realShiftTime'
             }
           },
+          // {
+          //   title: '上班时间',
+          //   align: 'center',
+          //   dataIndex: 'shiftTimeS'
+          // },
           {
-            title: '上班时间',
-            align: 'center',
-            dataIndex: 'shiftTimeS'
-          },
-          {
-            title: '上班打卡时间',
+            title: '最早打卡时间',
             align: 'center',
             dataIndex: 'gotoTime'
           },
+          // {
+          //   title: '下班时间',
+          //   align: 'center',
+          //   dataIndex: 'shiftTimeX'
+          // },
           {
-            title: '下班时间',
-            align: 'center',
-            dataIndex: 'shiftTimeX'
-          },
-          {
-            title: '下班打卡时间',
+            title: '最晚打卡时间',
             align: 'center',
             dataIndex: 'closingTime'
           }, {
-            title: '考勤状态',
+            title: '打卡次数',
             align: 'center',
+            dataIndex: 'attendanceCount', width: 100
+          }, {
+            title: '考勤状态',
+            align: 'center', width: 100,
             scopedSlots: {
               customRender: 'latetimeState'
             }
@@ -243,7 +247,7 @@
                 return 0;
               }
             }
-          }, */
+          }, 
           {
             title: '上班打卡',
             align: 'center',
@@ -253,7 +257,7 @@
             title: '下班打卡',
             align: 'center',
             dataIndex: 'closingState'
-          },
+          },*/
           {
             title: '加班开始时间',
             align: 'center',
@@ -298,7 +302,8 @@
           // }
         ],
         url: {
-          list: '/viewClockIn/viewClockIn/list'
+          list: '/viewClockIn/viewClockIn/list',
+          shift: "/shift/shift/lists"
         },
       }
     },
@@ -308,7 +313,7 @@
       }
     },
     created() {    //实例被创建时候执行
-// alert(1);
+        this.queryShift();
     },
     methods: {
       onDateChange: function (value, dateString) {
@@ -317,12 +322,22 @@
         this.queryParam.endViewDate=dateString[1];
       },
       onDateOk(value) {
-        console.log(value);
+        // console.log(value);
       },
       onChange(date, dateString) {
-            console.log(date, dateString);
+            // console.log(date, dateString);
             // this.value = "2021-01-01"
       },
+      queryShift() {
+        httpAction(this.url.shift, "", "get").then((res) => {
+          if (res.success) {
+            this.shiftlist = res.result;
+            console.log(res.result);
+          }
+        }).finally(() => {
+      
+        })
+      },
       jiaozhun(record) {
         // alert(record.viewDate);
         // alert(record.username);

+ 38 - 19
src/views/system/schedulingInformation/ViewClockUserInfo.vue

@@ -31,7 +31,6 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         @change="handleTableChange">
 
         <span slot="ShiftTime" slot-scope="text, record, index">
@@ -40,19 +39,18 @@
         
         <span slot="shiftType" slot-scope="text, record, index">
           <!-- ruleType 上班类型 1.固定时间上下班,2.按班次上下班,3.自由上下班 -->
-          <span v-if="record.latetimeS < 0 ">
-            上班打卡异常 <a>{{record.setInfo}}</a>
-          </span>
-          <span v-if="record.latetimeX > 0 ">
-            下班打卡异常 <a>{{record.setInfo}}</a>
-          </span>
-          <span v-if="record.demo != '' && record.demo != null">
-            异常 <a>{{record.setInfo}}</a>
-          </span>
-          <span v-if="record.name == '' || record.name == null">
+           <!--<span v-if="record.latetimeS < 0 || record.latetimeX > 0 || record.shiftRealTimeS == '' || record.shiftRealTimeS == null">
             异常 <a>{{record.setInfo}}</a>
           </span>
-          <span v-else>正常 <a>{{record.setInfo}}</a></span>
+          <span v-else>正常 <a>{{record.setInfo}}</a></span> -->
+          
+          <a-tag color="pink" v-if="record.latetimeS < 0 || record.latetimeX > 0 
+          || record.shiftRealTimeS == '' || record.shiftRealTimeS == null
+          && (record.setInfo == '' || record.setInfo == null)">
+          异常
+          </a-tag>
+          <a-tag color="#87d068" v-else>正常</a-tag>
+          <a>{{record.setInfo}}</a>
         </span>
         
         <span slot="action" slot-scope="text, record">
@@ -124,6 +122,7 @@
         deptName:'',//标题员工部门
         userType:'',//标题员工类型
         headMonth:'',//标题选择月份
+        newMonth:'',//更改时选择的月份
         currentDeptId: '',
         // 表头
         columns: [{
@@ -163,10 +162,16 @@
             align: "center",
             dataIndex: 'closingTime'
           },
+          {
+            title: '打卡次数',
+            align: "center",
+            dataIndex: 'attendanceCount'
+          },  
           {
             title: '加班申请',
             align: "center",
-            dataIndex: 'demo'
+            dataIndex: 'demo',
+            width: 200
           },
           {
             title: '操作',
@@ -193,6 +198,8 @@
 
     methods: {
       onDateChange: function (value, dateString) {
+        this.newMonth = dateString;
+        this.$emit('clearSelectedDepartKeys');
         // this.userName = e.node.dataRef.title;
         this.queryParam.mDate=dateString;
         this.loadData(1);
@@ -296,11 +303,18 @@
         });
       },
       open(selectedKeys, e) {
+        
+        if(e.node.dataRef.orgType == 1 || e.node.dataRef.orgType == 2 || e.node.dataRef.orgType == 3){
+          this.$message.warn("点击左侧加减号,展开或者收起菜单!")
+          return;
+        }
         this.queryParam = {}
-        this.userName = e.node.dataRef.title;
-        this.deptName = e.node.$parent.title;
-        this.userType = e.node.dataRef.orgType;
-        this.queryParam.userName=e.node.dataRef.title;
+        let arr = e.node.dataRef.title.split('(');//姓名
+        let arr2 = e.node.$parent.title.split('(');//上级部门
+        this.userName = arr[0];//e.node.dataRef.title;
+        this.deptName = arr2[0];//e.node.$parent.title;
+        this.userType = e.node.dataRef.orgType;//员工类型
+        this.queryParam.userName= arr[0];//e.node.dataRef.title;
         this.queryParam.mDate=moment(this.headMonth).format('YYYY-MM');
         this.loadData(1);
       },
@@ -330,6 +344,7 @@
         this.$refs.modalForm.endDate = record.closingTime;
         this.$refs.modalForm.viewDate = record.viewDate;
         this.$refs.modalForm.username = record.userId;
+        this.$refs.modalForm.setInfo = record.setInfo;
         this.$refs.modalForm.add(record);
       },
       handleAdd: function () {
@@ -365,14 +380,18 @@
              this.$message.warning("已设置过,不能再次设置");
              return;
           }
-          
+          if(record.demo == '' || record.demo == null){
+             this.$message.warning("该员工当日没有加班申请信息");
+             return;
+          }
           let that = this;
           fuXinInfo({viewDate:record.viewDate,userId:record.userId,st:st}).then((res) => {
             if (res == 'true') {
               that.$message.success("已成功设置");
-              that.loadData(1);
+              that.loadData();
             } else {
               that.$message.warning(res);
+              that.loadData();
             }
           });