Browse Source

2022.5.26 18:35

山水共长天一色 3 years ago
parent
commit
4861d2ea79

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

@@ -320,7 +320,7 @@
                         @change="selectProject(domain, index)"
                         :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
                             <!-- <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName" :value="item.id"></el-option> -->
-                            <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + item.projectCode" :value="item.id">
+                            <el-option v-for="item in fillProjectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
                                 <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
                                 <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
                             </el-option>
@@ -426,7 +426,7 @@
                             <el-select v-model="domain.projectId" placeholder="请选择项目" style="width:200px;" clearable="true"  filterable="true"
                             @change="selectProject(domain, index)"
                             :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
-                                <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + item.projectCode" :value="item.id">
+                                <el-option v-for="item in fillProjectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
                                     <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
                                     <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
                                 </el-option>
@@ -631,7 +631,7 @@
                 <div class="selConStyle_title">请选择要填报的项目</div>
                 <el-select v-model="selCon" multiple placeholder="请选择" filterable>
                     <el-option
-                    v-for="item in projectList"
+                    v-for="item in fillProjectList"
                     :disabled="item.status>=2"
                     :key="item.id"
                     :label="item.projectName"
@@ -1310,6 +1310,7 @@
                 listLoading: false,
 
                 projectList: [], //项目列表
+                fillProjectList: [],
                 reportList: [], //日报列表
                 reportNames:[], //批量审批列表
 
@@ -1839,7 +1840,7 @@
                     }
                     
                 }
-                console.log('domain',quanbu);
+                // console.log('domain',quanbu);
             },
             iptChang() {
                 var sl = this.workForm.domains
@@ -2047,7 +2048,7 @@
           if (res.code == "ok") {
             this.tbload = false;
             this.pickDateArray = res.data.days;
-            console.log('dataarray',res.data.days);
+            // console.log('dataarray',res.data.days);
             this.monthWorkData = res.data.list;
             // this.monthWorkDataS = this.monthWorkData
             // this.monthWorkDataS1 = res.data.list
@@ -2188,7 +2189,7 @@
             this.isFlag = true
             let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
             this.monthNotWorkDateS = datalist
-            console.log('length',this.monthNotWorkDateS.length)
+            // console.log('length',this.monthNotWorkDateS.length)
             setTimeout(()=>{
                 this.isFlag = false
             },300)
@@ -3429,7 +3430,7 @@
                             }
                         }
                         this.projectList = res.data;
-                        console.log("项目列表",this.projectList);
+                        // console.log("项目列表",this.projectList);
                     } else {
                         this.$message({
                             message: res.msg,
@@ -3445,6 +3446,33 @@
                     });
                 });
             },
+            // 获取填报日报的项目下拉列表
+            getFillProjectList() {
+                this.http.post( this.port.project.list, {
+                    forReport: 1
+                },res => {
+                    if (res.code == "ok") {
+                        for(var i in res.data) {
+                            if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
+                                res.data[i].projectCode = ''
+                            }
+                        }
+                        this.fillProjectList = res.data;
+
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
             getBasecostItemList() {
                 this.http.post('/project-basecost-setting/getReportBasecostList', {
                     companyId: this.user.companyId
@@ -3594,7 +3622,7 @@
 
             // 打开日报填写
             fillInReport(i, isBatch) {
-                console.log(this.user.timeType.type, '选择时长')
+                // console.log(this.user.timeType.type, '选择时长')
                 if(i != 1) {
                     this.falsss = false 
                 } else {
@@ -3614,7 +3642,7 @@
                     this.workForm.createDate = this.date + day; // 获取个人某天的日报
                     this.getReport(i);
                 } else {
-                    console.log('执行到了这里')
+                    // console.log('执行到了这里')
                     this.jsTime = 0
                     this.jsDay = 0
                     this.workForm = {
@@ -3634,7 +3662,7 @@
                             if(this.user.timeType.type == 1) {
                                 this.workForm.domains[0].workingTime = this.user.timeType.allday+'.0'
                             }
-                            console.log(this.workForm)
+                            // console.log(this.workForm)
                     if (this.timeBasecostList&&this.timeBasecostList.length>0) {
                         this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
                     }        
@@ -4884,6 +4912,7 @@
             this.getAllDate();
             this.getReportList();
             this.getProjectList();
+            this.getFillProjectList();
             this.getTimeType();
             this.getDepartment();
             this.scrollFunction()

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -1539,7 +1539,7 @@
         },
         
         mounted() {
-            // console.log(localStorage.getItem("formVal"))
+            console.log('user',this.user)
             var ua = navigator.userAgent.toLowerCase();
             this.isIOSystem = this.isIOS();
             if (ua.indexOf("wxwork") > 0) {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -382,7 +382,7 @@
                                 id: null,
                                 projectId: "",
                                 projectName: "",
-                                workingTime: this.user.timeType.allday,
+                                workingTime: "",
                                 content: "",
                                 state: 2,
                                 multiWorktime:0,

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

@@ -65,9 +65,9 @@
                 if(list[i].name == '工时报告') {
                     this.routers.push({name: '查看日报',url: '/calendar',icon: 'description'})
                     this.routers.push({name: '填写日报',url: '/edit',icon: 'edit'})
-                    if (this.user.companyId == 817 || this.user.companyId == 7 || this.user.companyId == 10) {
+                    // if (this.user.companyId == 817 || this.user.companyId == 7 || this.user.companyId == 10) {
                         this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'records'})
-                    }
+                    // }
                 }
                 if(list[i].name == '项目报告审核') {
                     this.routers.push({name: '项目报告审核',url: '/review',icon: 'todo-list-o'})

+ 87 - 6
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

@@ -3,13 +3,24 @@
         <van-nav-bar title="审核日报" left-text="返回" @click-left="back" fixed left-arrow/>
         
         <div class="login_form">
+            <div class="formBatch">
+                <van-checkbox v-model="isAllChecked" @click="allChecked" shape="square" style="padding-left:3vw"></van-checkbox>
+                <div style="padding:1vh 2vw">
+                <van-button @click="batchAgree(true)" type="info" size="small">批量通过</van-button>
+                <van-button @click="batchAgree(false)" type="danger" size="small" style="margin-left:2vw">批量驳回</van-button>
+                </div>
+            </div>
             <van-skeleton  v-for="(item,index) in report" :key="index" title avatar :row="3" :loading="false">
-                <van-panel class="one_report" :title="item.name" :status="item.state==0?(user.company.packageEngineering == 1 
-                                                    ?(item.data[0].departmentAuditState==-1?'待专业审核':
-                                                    (item.data[0].departmentAuditState==0?'待部门审核':
-                                                    '待项目经理审核')
-                                                    )
-                                                    :'待审核'):item.state==1?'已通过':'已驳回'">
+                <van-panel class="one_report">
+                    <template #header>
+                        <div class="van-cell van-panel__header">
+                            <div class="van-cell__title" style="display:flex;algin-items:center">
+                                <van-checkbox v-model="item.checked" @click="itemChecked" shape="square" style="margin-right:2vw"></van-checkbox>
+                                <span>{{item.name}}</span>
+                            </div>
+                            <div class="van-cell__value van-panel__header-value">{{item.state==0?(user.company.packageEngineering == 1 ? (item.data[0].departmentAuditState==-1?'待专业审核': (item.data[0].departmentAuditState==0?'待部门审核': '待项目经理审核')) : '待审核'):item.state==1?'已通过':'已驳回'}}</div>
+                        </div>
+                    </template>
                     <div class="form_text">
                         <span style="margin-left:5px;">工作日期: {{item.dateStr}}</span>
                         <span style="float:right;">
@@ -106,6 +117,7 @@
     export default {
         data() {
             return {
+                isAllChecked: false,
                 fullDayTxt:['全天','上午','下午'],
                 denyForm:{reason:null},
                 denyReasonDialog:false,
@@ -124,6 +136,59 @@
         created() {
         },
         methods: {
+            // 批量操作
+            allChecked(){
+                if(this.isAllChecked){
+                    for(let i in this.report){
+                        this.report[i].checked = true
+                    }
+                }else{
+                    for(let i in this.report){
+                        this.report[i].checked = false
+                    }
+                }
+            },
+            itemChecked(){
+                let isall = true
+                for(let i in this.report){
+                    if(!this.report[i].checked){
+                        isall = false
+                    }
+                }
+                this.isAllChecked = isall
+            },
+            batchAgree(bol){
+                const toast = this.$toast.loading({
+                    forbidClick: true,
+                    duration: 0
+                });
+                let ids = ''
+                for(let i in this.report){
+                    if(this.report[i].checked){
+                        for(let m in this.report[i].data){
+                            ids += this.report[i].data[m].id + ','
+                        }
+                    }
+                }
+                if(ids.length > 0){
+                    ids = ids.substring(0, ids.length-1);
+                }
+                let that = this
+                this.$axios.post(bol?'/report/batchApproveReport':'/report/batchDenyReport', {
+                    ids: ids
+                }).then(res => {
+                    if(res.code == "ok") {
+                        this.$toast.clear();
+                        setTimeout(function() {
+                            that.$toast.success('审核成功');
+                        }, 300);
+                        this.getReport();
+                    } else {
+                        this.$toast.clear();
+                        this.$toast.fail('批量操作失败:'+res.msg);
+                    }
+                }).catch(err=> {this.$toast.clear();});
+            },
             showLargeImg(item, index) {
                 this.imgShow = true;
                 this.tmpPics = item;
@@ -175,6 +240,9 @@
                     if(res.code == "ok") {
                         this.$toast.clear();
                         this.report = res.data;
+                        for(let i in this.report){
+                            this.$set(this.report[i],'checked',false)
+                        }
                     } else {
                         this.$toast.clear();
                         this.$toast.fail('获取失败:'+res.msg);
@@ -267,8 +335,21 @@
 </script>
 
 <style lang="less" scoped>
+    .formBatch{
+        position: fixed;
+        bottom: 0;
+        width: 100%;
+        z-index: 2;
+        background-color: #fff;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        height: 1.2rem;
+        border-top: 1px solid #ebebeb;
+    }
     .login_form {
         margin-top: 46px;
+        padding-bottom: 1.2rem;
     }
 
     .one_report {