LiGuang 3 rokov pred
rodič
commit
a32a56e572

+ 366 - 336
src/views/system/AttendanceRuleList.vue

@@ -6,124 +6,165 @@
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
 
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="规则名称">
-              <a-input placeholder="请输入规则名称" v-model="queryParam.name"></a-input>
+          <a-col :xl="6" :lg="6" :md="6" :sm="6">
+            <a-form-item label="员工名称">
+              <a-input placeholder="请输入员工名称" v-model="queryParam.name"></a-input>
             </a-form-item>
           </a-col>
-         <a-col :xl="6" :lg="7" :md="8" :sm="24">
-        <a-form-item label="日期">
-          <a-month-picker valueFormat="YYYY-MM-DD HH:mm:ss" format="YYYY-MM" placeholder="请选择日期" v-model="queryParam.ShiftDate" />
-        </a-form-item>
-         </a-col>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+          <a-col :xl="6" :lg="6" :md="6" :sm="6">
+            <a-form-item label="部门名称">
+              <a-input placeholder="请输入部门名称" v-model="queryParam.dept"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="6" :md="6" :sm="6">
+            <a-form-item label="日期">
+              <a-month-picker valueFormat="YYYY-MM-DD HH:mm:ss" format="YYYY-MM" placeholder="请选择日期"
+                v-model="queryParam.ShiftDate" />
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="6" :md="6" :sm="6">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQueryst" icon="search">查询</a-button>
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
-                {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a>
             </span>
           </a-col>
         </a-row>
       </a-form>
     </div>
 
- 
+
     <div>
-     
+
       <a-button @click="handleAddts()" type="primary" icon="plus" v-has="'UserShift:add'">调整</a-button>
-      <a-tabs default-active-key="1" @change="callback">
-        <a-tab-pane key="1" tab="已排班">
-         <a-table bordered rowKey="id" :data-source="dataSource" :columns="columns" :scroll="{ x:300 }"
-            :pagination="ipagination" @change="handleTableChange"  :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
+      <a-tabs default-active-key="2" @change="callback">
+        <a-tab-pane key="2" tab="按班次上下班">
+          <a-table bordered rowKey="id" :data-source="dataSource" :columns="columns" :scroll="{ x:300 }"
+            :pagination="ipagination" @change="handleTableChange"
+            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
             <template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
               <div style="height: 35px;">
                 <div style="text-align: center;margin-top: -10px;">
                   <p>{{dayobject.day.getDate()}}</p>
                   <div style="margin-top: -10px;">
-                  <p v-if='dayobject.day.getDay()==0'>日</p>
-                  <p v-else-if='dayobject.day.getDay()==1'>一</p>
-                  <p v-else-if='dayobject.day.getDay()==2'>二</p>
-                  <p v-else-if='dayobject.day.getDay()==3'>三</p>
-                  <p v-else-if='dayobject.day.getDay()==4'>四</p>
-                  <p v-else-if='dayobject.day.getDay()==5'>五</p>
-                  <p v-else-if='dayobject.day.getDay()==6'>六</p>
+                    <p v-if='dayobject.day.getDay()==0'>日</p>
+                    <p v-else-if='dayobject.day.getDay()==1'>一</p>
+                    <p v-else-if='dayobject.day.getDay()==2'>二</p>
+                    <p v-else-if='dayobject.day.getDay()==3'>三</p>
+                    <p v-else-if='dayobject.day.getDay()==4'>四</p>
+                    <p v-else-if='dayobject.day.getDay()==5'>五</p>
+                    <p v-else-if='dayobject.day.getDay()==6'>六</p>
                   </div>
                 </div>
               </div>
             </template>
-            
-           
-            
+
             <span v-for='(d,i) in tpdata' style="margin-left: -6px;" :slot="d" slot-scope="text, record, index">
-              <span v-if="record.type=='1'||record.type=='3'">
-                <a-tag color="blue" v-if="text=='休'" >{{text}}</a-tag>
-                <a-tag color="#87d068" v-else-if="text!=''&&text!=null">{{text}}</a-tag>
-              </span> 
 
-              <span v-else style="margin-left: -7px;" > 
-               <a-tag color="blue" v-if="text=='休息'" @click="UserType(d,record)">{{text}}</a-tag>
-                <a-tag color="#87d068" v-else-if="text!=''&&text!=null" @click="UserType(d,record)">{{text}}</a-tag>
-                
-                
+              <span style="margin-left: -7px;">
+                <a-tag color="blue" v-if="text=='休息'">{{text}}</a-tag>
+                <a-tag color="#87d068" v-else-if="text!=''&&text!=null">{{text}}</a-tag>
+              </span>
             </span>
-           </span>
           </a-table>
-        
-        <a-table bordered  :data-source="dataSources"  :columns="columnst" :scroll="{ x:300 }"
-          >
-           <template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
-             <div style="height: 35px;">
-               <div style="text-align: center;margin-top: -10px;">
-                 <p>{{dayobject.day.getDate()}}</p>
-                 <div style="margin-top: -10px;">
-                 <p v-if='dayobject.day.getDay()==0'>日</p>
-                 <p v-else-if='dayobject.day.getDay()==1'>一</p>
-                 <p v-else-if='dayobject.day.getDay()==2'>二</p>
-                 <p v-else-if='dayobject.day.getDay()==3'>三</p>
-                 <p v-else-if='dayobject.day.getDay()==4'>四</p>
-                 <p v-else-if='dayobject.day.getDay()==5'>五</p>
-                 <p v-else-if='dayobject.day.getDay()==6'>六</p>
-                 </div>
-               </div>
-             </div>
-           </template>
-           </a-table>
-      </a-tab-pane>
-      <a-tab-pane key="2" tab="未排班" force-render>
-       <a-table bordered :data-source="dataSource" rowKey="id" :columns="columns" :scroll="{ x:300 }"
-         :pagination="ipagination" @change="handleTableChange"  :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChanges}">
-         <template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
-           <div style="height: 35px;">
-             <div style="text-align: center;margin-top: -10px;">
-               <p>{{dayobject.day.getDate()}}</p>
-               <div style="margin-top: -10px;">
-               <p v-if='dayobject.day.getDay()==0'>日</p>
-               <p v-else-if='dayobject.day.getDay()==1'>一</p>
-               <p v-else-if='dayobject.day.getDay()==2'>二</p>
-               <p v-else-if='dayobject.day.getDay()==3'>三</p>
-               <p v-else-if='dayobject.day.getDay()==4'>四</p>
-               <p v-else-if='dayobject.day.getDay()==5'>五</p>
-               <p v-else-if='dayobject.day.getDay()==6'>六</p>
-               </div>
-             </div>
-           </div>
-         </template>
-        
-       </a-table>
-      </a-tab-pane>
-     
-    </a-tabs>
-    
+
+          <a-table bordered :data-source="dataSources" :columns="columnst" :scroll="{ x:300 }" :pagination="ipaginations" @change="handleTableChanges">
+            <template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
+              <div style="height: 35px;">
+                <div style="text-align: center;margin-top: -10px;">
+                  <p>{{dayobject.day.getDate()}}</p>
+                  <div style="margin-top: -10px;">
+                    <p v-if='dayobject.day.getDay()==0'>日</p>
+                    <p v-else-if='dayobject.day.getDay()==1'>一</p>
+                    <p v-else-if='dayobject.day.getDay()==2'>二</p>
+                    <p v-else-if='dayobject.day.getDay()==3'>三</p>
+                    <p v-else-if='dayobject.day.getDay()==4'>四</p>
+                    <p v-else-if='dayobject.day.getDay()==5'>五</p>
+                    <p v-else-if='dayobject.day.getDay()==6'>六</p>
+                  </div>
+                </div>
+              </div>
+            </template>
+          </a-table>
+        </a-tab-pane>
+        <a-tab-pane key="1" tab="固定时间上下班">
+          <a-table bordered rowKey="id" :data-source="dataSource" :columns="columns" :scroll="{ x:300 }"
+            :pagination="ipagination" @change="handleTableChange"
+            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
+            <template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
+              <div style="height: 35px;">
+                <div style="text-align: center;margin-top: -10px;">
+                  <p>{{dayobject.day.getDate()}}</p>
+                  <div style="margin-top: -10px;">
+                    <p v-if='dayobject.day.getDay()==0'>日</p>
+                    <p v-else-if='dayobject.day.getDay()==1'>一</p>
+                    <p v-else-if='dayobject.day.getDay()==2'>二</p>
+                    <p v-else-if='dayobject.day.getDay()==3'>三</p>
+                    <p v-else-if='dayobject.day.getDay()==4'>四</p>
+                    <p v-else-if='dayobject.day.getDay()==5'>五</p>
+                    <p v-else-if='dayobject.day.getDay()==6'>六</p>
+                  </div>
+                </div>
+              </div>
+            </template>
+
+          </a-table>
+        </a-tab-pane>
+        <a-tab-pane key="3" tab="自由时间上下班">
+          <a-table bordered rowKey="id" :data-source="dataSource" :columns="columns" :scroll="{ x:300 }"
+            :pagination="ipagination" @change="handleTableChange"
+            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
+            <template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
+              <div style="height: 35px;">
+                <div style="text-align: center;margin-top: -10px;">
+                  <p>{{dayobject.day.getDate()}}</p>
+                  <div style="margin-top: -10px;">
+                    <p v-if='dayobject.day.getDay()==0'>日</p>
+                    <p v-else-if='dayobject.day.getDay()==1'>一</p>
+                    <p v-else-if='dayobject.day.getDay()==2'>二</p>
+                    <p v-else-if='dayobject.day.getDay()==3'>三</p>
+                    <p v-else-if='dayobject.day.getDay()==4'>四</p>
+                    <p v-else-if='dayobject.day.getDay()==5'>五</p>
+                    <p v-else-if='dayobject.day.getDay()==6'>六</p>
+                  </div>
+                </div>
+              </div>
+            </template>
+
+          </a-table>
+        </a-tab-pane>
+        <a-tab-pane key="4" tab="未排班" force-render>
+          <a-table bordered :data-source="dataSource" rowKey="id" :columns="columns" :scroll="{ x:300 }"
+            :pagination="ipagination" @change="handleTableChange"
+            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChanges}">
+            <template v-for='(dayobject,i) in days' :slot="dayobject.day.getDate()" style="color: #ff6b81">
+              <div style="height: 35px;">
+                <div style="text-align: center;margin-top: -10px;">
+                  <p>{{dayobject.day.getDate()}}</p>
+                  <div style="margin-top: -10px;">
+                    <p v-if='dayobject.day.getDay()==0'>日</p>
+                    <p v-else-if='dayobject.day.getDay()==1'>一</p>
+                    <p v-else-if='dayobject.day.getDay()==2'>二</p>
+                    <p v-else-if='dayobject.day.getDay()==3'>三</p>
+                    <p v-else-if='dayobject.day.getDay()==4'>四</p>
+                    <p v-else-if='dayobject.day.getDay()==5'>五</p>
+                    <p v-else-if='dayobject.day.getDay()==6'>六</p>
+                  </div>
+                </div>
+              </div>
+            </template>
+
+          </a-table>
+        </a-tab-pane>
+
+      </a-tabs>
+
     </div>
     <!-- table区域-end -->
 
     <!-- 表单区域 -->
     <attendanceRule-modal ref="modalForm" @ok="modalFormOk"></attendanceRule-modal>
-    
-    <userShift-modal ref="userShiftModal" ></userShift-modal>
+
+    <userShift-modal ref="userShiftModal"></userShift-modal>
   </a-card>
 </template>
 
@@ -136,220 +177,145 @@
   } from '@/api/manage'
   import '@/assets/less/TableExpand.less'
   import AttendanceRuleModal from './modules/AttendanceRuleModal'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import {
+    JeecgListMixin
+  } from '@/mixins/JeecgListMixin'
   import UserShiftModal from './modules/UserShiftModal'
-import moment from "moment"
+  import moment from "moment"
   export default {
     name: "AttendanceRuleList",
-    mixins:[JeecgListMixin],
+    mixins: [JeecgListMixin],
     components: {
       AttendanceRuleModal,
       UserShiftModal
     },
-    data () {
+    data() {
       return {
-        queryParam:{
-          ShiftDate:moment(new Date()).format('yyyy-MM-DD HH:mm:ss'),
-          type:"1"
+        queryParam: {
+          ShiftDate: moment(new Date()).format('yyyy-MM-DD HH:mm:ss'),
+          type: "2"
         },
         description: '打卡规则管理页面',
-        tts:false,
-        tpdata:[],
+        tts: false,
+        tpdata: [],
         currentMonth: new Date().getMonth(),
         currentYear: new Date().getYear(),
-        selectedRowKeys:[],
-        selectionRows:[],
+        selectedRowKeys: [],
+        selectionRows: [],
         // 表头
         dataSource: [],
         dataSources: [],
         columns: [],
-        columnst:[],
-         days: [],
-         visibles: false,
-         shiftDate: null,
-         show: 1,
-         id: null,
-         shiftname: "",
-         username: "",
-         deptlist: null,
-         shiftlist: null,
-         isShow:true,
-         listData: [],
-         is:"1",
-		url: {
-         add: "/userShift/userShift/addUserShift",
-         userShift: "/userShift/userShift/queryByUser",
-         shift: "/shift/shift/lists",
-         list: "/sys/user/queryMothByUser",
-         moth: "/userShift/userShift/queryMothByUser",
-         deptlist: "/sys/sysDepart/listAll",
-         delUserShift: '/userShift/userShift/delete',
-         lists: "/sys/user/queryMothByCount",
-       },
-    }
-  },
-  computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-    }
-  }, created() {
-     // this.getListData(null)
+        columnst: [],
+        days: [],
+        visibles: false,
+        shiftDate: null,
+        show: 1,
+        id: null,
+        shiftname: "",
+        username: "",
+        deptlist: null,
+        shiftlist: null,
+        isShow: true,
+        listData: [],
+        is: "1",
+        ipaginations:{
+          current: 1,
+          pageSize: 10,
+          pageSizeOptions: ['10', '20', '30'],
+          showTotal: (total, range) => {
+            return range[0] + "-" + range[1] + " 共" + total + "条"
+          },
+          showQuickJumper: true,
+          showSizeChanger: true,
+          total: 0
+        },
+        url: {
+          add: "/userShift/userShift/addUserShift",
+          userShift: "/userShift/userShift/queryByUser",
+          shift: "/shift/shift/lists",
+          list: "/sys/user/queryMothByUser",
+          moth: "/userShift/userShift/queryMothByUser",
+          deptlist: "/sys/sysDepart/listAll",
+          delUserShift: '/userShift/userShift/delete',
+          lists: "/sys/user/queryMothByCount",
+        },
+      }
+    },
+    watch:{
+      dataSource:{
+         handler (newName, oldName) {
+              this.queryMothByCount();
+         },
+      }
+    },
+    computed: {
+      importExcelUrl: function() {
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      }
+    },
+    created() {
+      // this.getListData(null)
       this.initData(null)
       this.queryShift()
       this.queryMothByCount();
     },
+    
     methods: {
-      handleAddts(){
-        if(this.selectedRowKeys.length<1&&this.queryParam.type=="2"){
+      handleAddts() {
+        if (this.selectedRowKeys.length < 1 && this.queryParam.type == "4") {
           this.$message.warning("请勾选需要排班人员");
           return;
-        }else if(this.selectedRowKeys.length<1&&this.queryParam.type=="1"){
+        } else if (this.selectedRowKeys.length < 1 && (this.queryParam.type == "1" || this.queryParam.type == "2" ||
+            this.queryParam.type == "3")) {
           this.$message.warning("请勾选需要变更人员");
           return;
         }
-        
-        if(this.selectedRowKeys.length>0&&this.queryParam.type=="2"){
-          this.$refs.modalForm.add(this.selectedRowKeys,this.selectionRows);
-          
-        }else if(this.selectedRowKeys.length>0&&this.queryParam.type=="1"){
-          this.$refs.modalForm.edit(this.selectedRowKeys,this.selectionRows);
+
+        if (this.selectedRowKeys.length > 0 && this.queryParam.type == "4") {
+          this.$refs.modalForm.add(this.selectedRowKeys, this.selectionRows);
+
+        } else if (this.selectedRowKeys.length > 0 && (this.queryParam.type == "1" || this.queryParam.type == "2" ||
+            this.queryParam.type == "3")) {
+          this.$refs.modalForm.edit(this.selectedRowKeys, this.selectionRows);
         }
       },
       onSelectChanges(selectedRowKeys, selectionRows) {
         console.log(selectedRowKeys)
         this.selectedRowKeys = selectedRowKeys;
-        this.selectionRows=selectionRows;
-        
+        this.selectionRows = selectionRows;
+
       },
-    callback(key) {
-      this.queryParam.type=key;
-      this.selectedRowKeys=[];
-      this.selectionRows=[];
-      this.$options.methods.searchQuery.call(this)
-         this.initData(this.queryParam.ShiftDate)
-        },
-     searchQueryst (){
-        this.queryMothByCount()
+      callback(key) {
+        this.queryParam.type = key;
+        this.selectedRowKeys = [];
+        this.selectionRows = [];
         this.$options.methods.searchQuery.call(this)
-        console.log(this.queryParam.ShiftDate)
         this.initData(this.queryParam.ShiftDate)
-       
       },
-      UserType(e,a){
-        
-        this.isShow=true;
-        var d = new Date(this.formatDate(this.currentYear, this.currentMonth, e))
-        if(a.category==106){
-          if(d.getDay()==0){
-            this.isShow=false;
-          }
-         
-        }else{
-          if(d.getDay()==0||d.getDay()==6){
-            this.isShow=false;
-          }
-        }
-      
-      },
-      shiftOks(a,b,c,d){
-        console.log(c)
-        console.log(d)
-        var date=this.currentYear + "-" + this.currentMonth + "-" + b + " 00:00:000"; 
-        var name=a.name;
-        if(a==0||a=="0"){
-          name="休息";
-        httpAction(this.url.add, {
-          userId: c.id,
-          shiftId:0,
-          shiftDate: date
-        }, "post").then((res) => {
-          if (res.success) {
-           
-          }
-        })
-        }else{
-          httpAction(this.url.add, {
-            userId: c.id,
-            shiftId:a.id,
-            shiftDate: date
-          }, "post").then((res) => {
-            if (res.success) {
-             
-            }
-          })
-        }
-        
-        
-        if (b==1) {
-          c.a1=name;
-        } else if (b == 2) {             
-          c.a2=name;
-        } else if (b == 3) {             
-         c.a3=name;
-        } else if (b == 4) {             
-         c.a4=name;
-        } else if (b == 5) {             
-         c.a5=name;
-        } else if (b == 6) {           
-         c.a6=name;
-        } else if (b == 7) {             
-         c.a7=name;
-        } else if (b== 8) {             
-          c.a8=name;
-        } else if (b== 9) {            
-          c.a9=name;
-        } else if (b== 10) {             
-          c.a10=name;
-        } else if (b == 11) {            
-          c.a11=name;
-        } else if (b == 12) {            
-         c.a12=name;
-        } else if (b == 13) {              
-          c.a13=name;
-        } else if (b == 14) {              
-         c.a14=name;
-        } else if (b == 15) {              
-          c.a15=name;
-        } else if (b == 16) {             
-          c.a16=name;
-        } else if (b== 17) {              
-          c.a17=name;
-        } else if (b== 18) {              
-          c.a18=name;
-        } else if (b == 19) {             
-          c.a19=name;
-        } else if (b == 20) {             
-         c.a20=name;
-        } else if (b == 21) {              
-          c.a21=name;
-        } else if (b == 22) {             
-          c.a22=name;
-        } else if (b == 23) {             
-          c.a23=name;
-        } else if (b == 24) {            
-         c.a24=name;
-        } else if (b== 25) {              
-          c.a25=name;
-        } else if (b == 26) {              
-          c.a26=name;
-        } else if (b == 27) {             
-          c.a27=name;
-        } else if (b == 28) {              
-          c.a28=name;
-        } else if (b == 29) {              
-          c.a29=name;
-        } else if (b == 30) {             
-         c.a30=name;
-        } else if (b == 31) {
-          c.a31=name;
-        }
-       
-       
+      searchQueryst() {
+        this.queryMothByCount()
+        this.$options.methods.searchQuery.call(this)
+        this.initData(this.queryParam.ShiftDate)
+
       },
+    handleTableChanges(pagination, filters, sorter) {
+      //分页、排序、筛选变化时触发
+      //TODO 筛选
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field;
+        this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+      }
+      this.ipaginations = pagination;
+      console.log(pagination)
+      this.queryMothByCount();
+    },
+
       initData: function(cur) {
         this.columns = [];
         this.columnst = [];
-        // this.this.days=[];
+        this.tpdata = [];
+        this.days = [];
         var date
         if (cur) {
           date = new Date(cur)
@@ -360,8 +326,8 @@ import moment from "moment"
         this.currentDay = date.getDate()
         this.currentYear = date.getFullYear()
         this.currentMonth = date.getMonth() + 1
-  
-      
+
+
         var str = this.formatDate(
           this.currentYear,
           this.currentMonth,
@@ -370,7 +336,7 @@ import moment from "moment"
         this.days.length = 0
         var moth = new Date(str);
         moth.setDate(28)
-      
+
         moth.setMonth(moth.getMonth() + 1);
         moth.setDate(0);
         this.columns.push({
@@ -391,53 +357,106 @@ import moment from "moment"
           width: '100px',
           fixed: 'left'
         })
-        if(this.queryParam.type=="1"){
-        this.columns.push({
-          title: '类型',
-          dataIndex: 'type',
-          width: '100px',
-          fixed: 'left',
-          customRender:function(t,r,index){
-            var name="";
-            if(t==1||t=="1"){
-              name="固定时间上下班";
-            }else if(t==2||t=="2"){
-               name="按班次上下班";
-            }else if(t==3||t=="3"){
-               name="自由时间上下班";
+        if (this.queryParam.type == "1" || this.queryParam.type == "2" || this.queryParam.type == "3") {
+          this.columns.push({
+            title: '类型',
+            dataIndex: 'type',
+            width: '100px',
+            fixed: 'left',
+            customRender: function(t, r, index) {
+              var name = "";
+              if (t == 1 || t == "1") {
+                name = "固定时间上下班";
+              } else if (t == 2 || t == "2") {
+                name = "按班次上下班";
+              } else if (t == 3 || t == "3") {
+                name = "自由时间上下班";
+              }
+              return name;
             }
-            return name;
+          })
+          if(this.queryParam.type == "1"){
+            this.columns.push({
+              title: '上班时间',
+              dataIndex: 'startDate',
+              width: '100px',
+              fixed: 'left',
+              customRender: function(t, r, index) {
+                var date = "";
+                if (t!=null&&t!="") {
+                  date=moment(new Date(t)).format('HH:mm:ss')
+                 }
+                return date;
+              }
+            })
+            this.columns.push({
+              title: '下班时间',
+              dataIndex: 'endDate',
+              width: '100px',
+              fixed: 'left',
+             customRender: function(t, r, index) {
+               var date = "";
+               if (t!=null&&t!="") {
+                 date=moment(new Date(t)).format('HH:mm:ss')
+                }
+               return date;
+             }
+            })
           }
-        })
-        
-        for (var i = 1; i <= moth.getDate(); i++) {
-          var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
-          this.tpdata.push(i)
-          var dayobjectSelf = {
-            width: '49px',
-            slots: {
-              title: d.getDate()
-            },
-            dataIndex: "a" + d.getDate(),
-            scopedSlots: {customRender:i},
-            
-          } // 用一个对象包装Date对象  以便为以后预定功能添加属性
           
-          var dayobjectSelfs = {
-            width: '49px',
-            slots: {
-              title: d.getDate()
-            },
-            dataIndex: "b" + d.getDate(),
-          }
-          var dat = {};
-          dat.day = d;
           
-          this.days.push(dat)
-          this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
-          this.columnst.push(dayobjectSelfs)
-        }
-        }else{
+
+          if (this.queryParam.type == "2") {
+            for (var i = 1; i <= moth.getDate(); i++) {
+              var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
+              this.tpdata.push(i)
+              var dayobjectSelf = {
+                width: '49px',
+                slots: {
+                  title: d.getDate()
+                },
+                dataIndex: "a" + d.getDate(),
+                scopedSlots: {
+                  customRender: i
+                },
+
+              } // 用一个对象包装Date对象  以便为以后预定功能添加属性
+
+              var dayobjectSelfs = {
+                width: '49px',
+                slots: {
+                  title: d.getDate()
+                },
+                dataIndex: "b" + d.getDate(),
+              }
+              var dat = {};
+              dat.day = d;
+
+              this.days.push(dat)
+              this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
+              this.columnst.push(dayobjectSelfs)
+            }
+          } else {
+            for (var i = 1; i <= moth.getDate(); i++) {
+              var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
+              this.tpdata.push(i)
+              var dayobjectSelf = {
+                width: '49px',
+                slots: {
+                  title: d.getDate()
+                },
+                dataIndex: "a" + d.getDate(),
+
+              } // 用一个对象包装Date对象  以便为以后预定功能添加属性
+              var dat = {};
+              dat.day = d;
+
+              this.days.push(dat)
+              this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
+            }
+
+          }
+        } else {
           for (var i = 1; i <= moth.getDate(); i++) {
             var d = new Date(this.formatDate(this.currentYear, this.currentMonth, i))
             this.tpdata.push(i)
@@ -447,16 +466,16 @@ import moment from "moment"
                 title: d.getDate()
               },
               dataIndex: "a" + d.getDate(),
-              
+
             } // 用一个对象包装Date对象  以便为以后预定功能添加属性
             var dat = {};
             dat.day = d;
-            
+
             this.days.push(dat)
             this.columns.push(dayobjectSelf) // 将日期放入data 中的days数组 供页面渲染使用
           }
         }
-       
+
       },
       queryShift() {
         httpAction(this.url.shift, "", "get").then((res) => {
@@ -464,20 +483,31 @@ import moment from "moment"
             this.shiftlist = res.result;
           }
         }).finally(() => {
-      
+
         })
-      
+
       },
       queryMothByCount() {
-        httpAction(this.url.lists,{shiftDate:moment(this.queryParam.ShiftDate).format('yyyy-MM-DD HH:mm:ss')}, "post").then((res) => {
+        httpAction(this.url.lists, {
+          shiftDate: moment(this.queryParam.ShiftDate).format('yyyy-MM-DD HH:mm:ss'),
+          userId:this.ipaginations.current,
+          shiftId: this.ipaginations.pageSize
+        }, "post").then((res) => {
           if (res.success) {
-            this.dataSources=res.result;
-            console.log(res)
+            //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
+            this.dataSources = res.result.records||res.result;
+            if(res.result.total)
+            {
+              this.ipaginations.total = res.result.total+1;
+            }else{
+              this.ipaginationstotal = 0+1;
+            }
+            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
           }
         }).finally(() => {
-      
+
         })
-      
+
       },
       // 返回 类似 2016-01-02 格式的字符串
       formatDate: function(year, month, day) {
@@ -492,20 +522,20 @@ import moment from "moment"
         if (d < 10) d = '0' + d
         return y + '-' + m + '-' + d
       }
-    
+
     }
   }
 </script>
 <style scoped>
   @import '~@assets/less/common.less';
-  
+
   .month {
     width: 100%;
     color: #333333;
     background: #ffffff;
     margin-top: -20px;
   }
-  
+
   .month ul {
     margin: 0;
     padding: 0;
@@ -514,31 +544,31 @@ import moment from "moment"
     height: 30px;
     list-style-type: none;
   }
-  
+
   .year-month {
     display: flex;
     align-items: center;
     justify-content: space-around;
     margin-top: 10px;
   }
-  
+
   .choose-month {
     text-align: center;
     font-size: 12px;
   }
-  
+
   .arrow {
     padding: 15px;
     color: #999999;
   }
-  
+
   .month ul li {
     font-size: 12px;
     text-transform: uppercase;
     letter-spacing: 3px;
   }
-  
-  
+
+
   .weekdays {
     margin: 0;
     padding: 10px;
@@ -548,13 +578,13 @@ import moment from "moment"
     justify-content: space-around;
     background: #ffffff;
   }
-  
+
   .weekdays li {
     display: inline-block;
     width: 13.6%;
     text-align: center;
   }
-  
+
   .days {
     padding: 10px;
     background: #ffffff;
@@ -562,7 +592,7 @@ import moment from "moment"
     display: flex;
     flex-wrap: wrap;
   }
-  
+
   .ts {
     padding: 20px;
     background: #ffffff;
@@ -570,7 +600,7 @@ import moment from "moment"
     display: flex;
     flex-wrap: wrap;
   }
-  
+
   .days li {
     list-style-type: none;
     display: inline-block;
@@ -582,24 +612,24 @@ import moment from "moment"
     color: #000;
     height: 40px;
   }
-  
+
   .days li .active {
     padding: 8px 10px;
     border-radius: 5%;
     background: #00b8ec;
     color: #fff;
-  
+
   }
-  
+
   .days li .other-month {
     padding: 5px;
     color: gainsboro;
   }
-  
+
   .days li:hover .act {
     padding: 6px 10px;
     border-radius: 50%;
     background: #e1e1e1;
     color: #fff;
   }
-</style>
+</style>

+ 1 - 22
src/views/system/UserList.vue

@@ -88,14 +88,7 @@
             <a-icon type="delete" @click="batchDel"/>
             删除
           </a-menu-item>
-          <a-menu-item key="2">
-            <a-icon type="lock" @click="batchFrozen('2')"/>
-            冻结
-          </a-menu-item>
-          <a-menu-item key="3">
-            <a-icon type="unlock" @click="batchFrozen('1')"/>
-            解冻
-          </a-menu-item>
+    
         </a-menu>
         <a-button style="margin-left: 8px">
           批量操作
@@ -159,9 +152,6 @@
                 <a href="javascript:;" @click="handleDetail(record)">详情</a>
               </a-menu-item>
 
-              <!-- <a-menu-item v-has='"user:pwd"'>
-                <a href="javascript:;" @click="handleChangePassword(record.username)">密码</a>
-              </a-menu-item> -->
 
               <a-menu-item v-has='"user:delete"'>
                 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
@@ -169,17 +159,6 @@
                 </a-popconfirm>
               </a-menu-item>
 
-             <!-- <a-menu-item v-if="record.status==1" v-has='"user:frozen"'>
-                <a-popconfirm title="确定冻结吗?" @confirm="() => handleFrozen(record.id,2,record.username)">
-                  <a>冻结</a>
-                </a-popconfirm>
-              </a-menu-item> -->
-
-              <!-- <a-menu-item v-if="record.status==2" v-has='"user:thaw"'>
-                <a-popconfirm title="确定解冻吗?" @confirm="() => handleFrozen(record.id,1,record.username)">
-                  <a>解冻</a>
-                </a-popconfirm>
-              </a-menu-item> -->
             </a-menu>
           </a-dropdown>
         </span>

+ 7 - 2
src/views/system/modules/AttendanceRuleModal.vue

@@ -10,7 +10,7 @@
             <a-radio value="3">自由上下班</a-radio>
           </a-radio-group>
         </a-form-item>
-
+        
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="*上班时间" v-if="types==1">
           <a-time-picker showTime format='HH:mm:ss' v-model="startDate" />
         </a-form-item>
@@ -122,7 +122,7 @@
     JeecgListMixin
   } from '@/mixins/JeecgListMixin'
   import '@/assets/less/TableExpand.less'
-
+  import ar from '../AttendanceRuleList.vue'
   export default {
     name: "UserShiftModal",
     mixins: [JeecgListMixin],
@@ -736,6 +736,11 @@
         this.id=a[0].id;
         this.queryParam.shiftDate=moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
         this.queryParam.type="2";
+        if(a[0].startDate!=null){
+          this.startDate=moment(new Date(a[0].startDate)).format('YYYY-MM-DD HH:mm:ss');
+        }if(a[0].endDate!=null){
+          this.endDate=moment(new Date(a[0].endDate)).format('YYYY-MM-DD HH:mm:ss');
+        }
          this.$options.methods.searchQuery.call(this)
       }
 

+ 7 - 28
src/views/system/modules/SelectUserListModal.vue

@@ -12,8 +12,8 @@
         <a-row :gutter="24">
 
           <a-col :span="6">
-            <a-form-item label="号">
-              <a-input placeholder="请输入账号" v-model="queryParam.username"></a-input>
+            <a-form-item label="号">
+              <a-input placeholder="请输入工号" v-model="queryParam.workNo"></a-input>
             </a-form-item>
           </a-col>
 
@@ -41,15 +41,7 @@
               </a-form-item>
             </a-col>
 
-            <a-col :span="6">
-              <a-form-item label="状态">
-                <a-select v-model="queryParam.status" placeholder="请选择状态">
-                  <a-select-option value="">请选择状态</a-select-option>
-                  <a-select-option value="1">正常</a-select-option>
-                  <a-select-option value="2">解冻</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
+            
           </template>
 
           <a-col :span="6" >
@@ -92,16 +84,16 @@
     },
     data () {
       return {
-        title:"选择用户",
+        title:"选择员工",
         queryParam: {},
         columns: [{
-          title: '用户账号',
+          title: '号',
           align:"center",
-          dataIndex: 'username',
+          dataIndex: 'workNo',
           fixed:'left',
           width:200
         },{
-          title: '用户名称',
+          title: '员工姓名',
           align:"center",
           dataIndex: 'realname',
         },{
@@ -125,19 +117,6 @@
           title: '邮箱',
           align:"center",
           dataIndex: 'email'
-        },{
-          title: '状态',
-          align:"center",
-          dataIndex: 'status',
-          customRender:function (text) {
-            if(text==1){
-              return "正常";
-            }else if(text==2){
-              return "冻结";
-            }else{
-              return text;
-            }
-          }
         }],
         dataSource:[],
         ipagination:{

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 414 - 565
src/views/system/modules/UserModal.vue


+ 8 - 8
src/views/system/modules/UserRecycleBinModal.vue

@@ -65,8 +65,8 @@
         throw new Error(res.message)
       }
     }).catch(e => {
-      console.error('查询已删除的用户失败:', e)
-      this.$message.warning('查询已删除的用户失败:' + (e.message || e))
+      console.error('查询已删除的员工失败:', e)
+      this.$message.warning('查询已删除的员工失败:' + (e.message || e))
     }).finally(() => {
       this.loading = false
     })
@@ -135,15 +135,15 @@
       // 还原用户
       handleRevert(userIds) {
         this.$confirm({
-          title: '恢复用户',
-          content: `您确定要恢复这 ${userIds.length} 个用户吗?`,
+          title: '恢复员工',
+          content: `您确定要恢复这 ${userIds.length} 个员工吗?`,
           centered: true,
           onOk: () => {
             putAction(this.url.putRecycleBin,{userIds:userIds.join(',')}).then((res)=>{
               if(res.success){
                 this.handleOk()
                 this.handleClearSelection()
-                this.$message.success(`还原 ${userIds.length} 个用户成功!`)
+                this.$message.success(`还原 ${userIds.length} 个员工成功!`)
               }
             })
           }
@@ -152,9 +152,9 @@
       // 彻底删除用户
       handleDelete(userIds) {
         this.$confirm({
-          title: '彻底删除用户',
+          title: '彻底删除员工',
           content: (<div>
-            <p>您确定要彻底删除这 {userIds.length} 个用户吗?</p>
+            <p>您确定要彻底删除这 {userIds.length} 个员工吗?</p>
             <p style="color:red;">注意:彻底删除后将无法恢复,请谨慎操作!</p>
           </div>),
           centered: true,
@@ -164,7 +164,7 @@
               if (res.success) {
                 this.loadData()
                 this.handleClearSelection()
-                this.$message.success(`彻底删除 ${userIds.length} 个用户成功!`)
+                this.$message.success(`彻底删除 ${userIds.length} 个员工成功!`)
               } else {
                 that.$message.warning(res.message);
               }

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov