소스 검색

2022.8.12 移动端日报审核筛选

ggooalice 2 년 전
부모
커밋
2b8df5a89e

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

@@ -377,7 +377,7 @@
                   <el-table-column prop="groupName" label="分组名称" min-width="100"></el-table-column>
                   <el-table-column prop="workingTime" label="工时(h)" min-width="50" align="right" header-align="center">
                     <template slot-scope="scope">
-                      <span style="margin-right:20px">{{scope.row.workingTime ? scope.row.workingTime.toFixed(1) + '(h)' : ''}}</span>
+                      <span style="margin-right:20px">{{scope.row.workingTime ? scope.row.workingTime.toFixed(1) : ''}}</span>
                     </template>
                   </el-table-column>
                 </el-table-column>

+ 93 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

@@ -3,6 +3,19 @@
         <van-nav-bar title="审核日报" left-text="返回" @click-left="back" fixed left-arrow/>
         
         <div class="login_form">
+            <van-sticky offset-top="1.22667rem" style="margin-bottom:10px">
+                <van-cell title="选择日期" :value="selectDateValue" @click="selectShow = true" />
+                <van-calendar v-model="selectShow" :min-date="minDate" type="range" @confirm="selectConfirm" />
+                <van-cell title="选择人员" :value="userNameValue" @click="selectUserShow = true" value-class="userNameValue" />
+                <van-popup v-model="selectUserShow" position="bottom">
+                    <van-search v-model="searchInputValue" placeholder="输入员工姓名搜索" @search="userListSearch"></van-search>
+                    <div style="minHeight:300px;">
+                        <van-checkbox class="userCheckbox" v-for="(item) in showUserList" :key="item.id" v-model="item.isChecked" >{{item.name}}</van-checkbox>
+                        <van-button style="width:100%;position: -webkit-sticky;position: sticky;bottom: 0;" @click="selectUserConfirm();selectUserShow=false">确定</van-button>
+                    </div>
+                </van-popup>
+            </van-sticky>
+
             <div class="formBatch">
                 <van-checkbox v-model="isAllChecked" :disabled="report.length == 0" @click="allChecked" shape="square" style="padding-left:3vw"></van-checkbox>
                 <div style="padding:1vh 2vw">
@@ -142,12 +155,73 @@
                 isCanAgree: false,
                 approveinData: null,
                 approveinDialog: false,
-                isbatch: false
+                isbatch: false,
+
+                selectDate: [],
+                selectDateValue: '',
+                selectShow: false,
+                userList: [],
+                showUserList: [],
+                userIdList: [],
+                userNameValue: '',
+                searchInputValue: '',
+                selectUserShow: false
             };
         },
         created() {
         },
         methods: {
+
+            selectConfirm(date){
+                const [start, end] = date;
+                this.selectShow = false;
+                this.selectDate = [this.getSelectDateStr(start),this.getSelectDateStr(end)]
+                this.selectDateValue = `${this.selectDate[0]} 至 ${this.selectDate[1]}`;
+                this.getReport()
+            },
+            getSelectDateStr(date){
+                return `${date.getFullYear()}-${(date.getMonth() + 1) < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)}-${date.getDate() < 10 ? '0' + date.getDate() : date.getDate()}`;
+            },
+            userListSearch(val) {
+                console.log(val);
+                this.showUserList = [];
+                this.userList.forEach(u=>{if (u.name.startsWith(val)) {
+                    this.showUserList.push(u);
+                }})
+            },
+            selectUserConfirm(){
+                this.userNameValue = '';
+                var that = this;
+                that.userIdList = '';
+                this.userList.filter(u=>u.isChecked).forEach(u=>{
+                    that.userNameValue += (u.name+',');
+                    that.userIdList += u.id + ','
+                });
+                if (this.userNameValue.length > 0) {
+                    this.userNameValue = this.userNameValue.substring(0, this.userNameValue.length-1);
+                    this.userIdList = this.userIdList.substring(0, this.userIdList.length-1);
+                }
+                this.getReport()
+            },
+
+            getUsers() {
+                this.$axios.post("/user/getEmployeeList", {
+                    departmentId: -1,
+                    pageIndex: 1,
+                    // pageSize: 99999
+                    pageSize: -1
+                })
+                .then(res => {
+                    if(res.code == "ok") {
+                        this.userList = res.data.records;
+                        this.showUserList = res.data.records
+                    } else {
+                        this.$toast.fail('获取失败');
+                    }
+                }).catch(err=> {this.$toast.clear();});
+            },
+
+
             // 批量操作
             allChecked(){
                 if(this.isAllChecked){
@@ -289,7 +363,17 @@
                     forbidClick: true,
                     duration: 0
                 });
-                this.$axios.post("/report/listByState", {state: 0})
+                let parameter = {
+                    state: 0
+                }
+                if(this.selectDate.length != 0){
+                    parameter.startDate = this.selectDate[0]
+                    parameter.endDate = this.selectDate[1]
+                }
+                if(this.userIdList){
+                    parameter.userId = this.userIdList
+                }
+                this.$axios.post("/report/listByState", parameter)
                 .then(res => {
                     if(res.code == "ok") {
                         this.$toast.clear();
@@ -397,6 +481,7 @@
 
         mounted() {
             this.getReport();
+            this.getUsers()
             var list = this.user.functionList
             for(var i in list) {
                 if(list[i].name == '审核全员日报') {
@@ -408,6 +493,12 @@
 </script>
 
 <style lang="less" scoped>
+.userCheckbox {
+        padding: 10px;;
+    }
+    .userNameValue{
+        white-space: nowrap;
+    }
     .formBatch{
         position: fixed;
         bottom: 0;